bloggit 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/History +4 -0
- data/Manifest +422 -0
- data/Rakefile +64 -0
- data/ReadMe +69 -0
- data/Todo +26 -0
- data/bin/bloggit +5 -0
- data/docs/index.html +57 -0
- data/docs/specifications.html +100 -0
- data/docs/src/_layout.rhtml +53 -0
- data/docs/src/index.markdown +5 -0
- data/docs/src/specifications.markdown +48 -0
- data/lib/bloggit.rb +28 -0
- data/lib/bloggit/boilerplate/Rakefile +2 -0
- data/lib/bloggit/boilerplate/pages/about.page +5 -0
- data/lib/bloggit/boilerplate/plugins/haloscan/init.rb +5 -0
- data/lib/bloggit/boilerplate/settings.yml +28 -0
- data/lib/bloggit/boilerplate/themes/default/styles/main.css +145 -0
- data/lib/bloggit/boilerplate/themes/default/templates/archive.rhtml +20 -0
- data/lib/bloggit/boilerplate/themes/default/templates/home.rhtml +6 -0
- data/lib/bloggit/boilerplate/themes/default/templates/layouts/main.rhtml +15 -0
- data/lib/bloggit/boilerplate/themes/default/templates/layouts/two-columns.rhtml +21 -0
- data/lib/bloggit/boilerplate/themes/default/templates/page.rhtml +8 -0
- data/lib/bloggit/boilerplate/themes/default/templates/post.rhtml +3 -0
- data/lib/bloggit/boilerplate/themes/default/templates/snippets/blog_entry.rhtml +16 -0
- data/lib/bloggit/boilerplate/themes/default/templates/snippets/navigation.rhtml +12 -0
- data/lib/bloggit/boilerplate/themes/default/templates/snippets/tag_list.rhtml +9 -0
- data/lib/bloggit/boilerplate/themes/default/templates/tag_archive.rhtml +38 -0
- data/lib/bloggit/checksum.rb +39 -0
- data/lib/bloggit/client/index.html +2 -0
- data/lib/bloggit/client/scripts/adapter/jquery/ext-jquery-adapter.js +12 -0
- data/lib/bloggit/client/scripts/adapter/jquery/jquery-plugins.js +965 -0
- data/lib/bloggit/client/scripts/adapter/jquery/jquery.js +2201 -0
- data/lib/bloggit/client/scripts/adapter/prototype/effects.js +1098 -0
- data/lib/bloggit/client/scripts/adapter/prototype/ext-prototype-adapter.js +12 -0
- data/lib/bloggit/client/scripts/adapter/prototype/prototype.js +2523 -0
- data/lib/bloggit/client/scripts/adapter/prototype/scriptaculous.js +59 -0
- data/lib/bloggit/client/scripts/adapter/yui/ext-yui-adapter.js +12 -0
- data/lib/bloggit/client/scripts/adapter/yui/yui-utilities.js +18 -0
- data/lib/bloggit/client/scripts/app.js +121 -0
- data/lib/bloggit/client/scripts/ext-all.js +256 -0
- data/lib/bloggit/client/scripts/resources/css/README.txt +3 -0
- data/lib/bloggit/client/scripts/resources/css/basic-dialog.css +286 -0
- data/lib/bloggit/client/scripts/resources/css/box.css +111 -0
- data/lib/bloggit/client/scripts/resources/css/button.css +148 -0
- data/lib/bloggit/client/scripts/resources/css/combo.css +46 -0
- data/lib/bloggit/client/scripts/resources/css/core.css +290 -0
- data/lib/bloggit/client/scripts/resources/css/date-picker.css +155 -0
- data/lib/bloggit/client/scripts/resources/css/dd.css +61 -0
- data/lib/bloggit/client/scripts/resources/css/debug.css +55 -0
- data/lib/bloggit/client/scripts/resources/css/ext-all.css +3167 -0
- data/lib/bloggit/client/scripts/resources/css/form.css +359 -0
- data/lib/bloggit/client/scripts/resources/css/grid.css +295 -0
- data/lib/bloggit/client/scripts/resources/css/layout.css +252 -0
- data/lib/bloggit/client/scripts/resources/css/menu.css +116 -0
- data/lib/bloggit/client/scripts/resources/css/panel.css +258 -0
- data/lib/bloggit/client/scripts/resources/css/qtips.css +119 -0
- data/lib/bloggit/client/scripts/resources/css/reset-min.css +9 -0
- data/lib/bloggit/client/scripts/resources/css/resizable.css +143 -0
- data/lib/bloggit/client/scripts/resources/css/tabs.css +134 -0
- data/lib/bloggit/client/scripts/resources/css/toolbar.css +160 -0
- data/lib/bloggit/client/scripts/resources/css/tree.css +179 -0
- data/lib/bloggit/client/scripts/resources/css/window.css +155 -0
- data/lib/bloggit/client/scripts/resources/css/ytheme-aero.css +581 -0
- data/lib/bloggit/client/scripts/resources/css/ytheme-gray.css +438 -0
- data/lib/bloggit/client/scripts/resources/css/ytheme-vista.css +511 -0
- data/lib/bloggit/client/scripts/resources/images/aero/basic-dialog/aero-close-over.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/basic-dialog/aero-close.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/basic-dialog/bg-center.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/basic-dialog/bg-left.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/basic-dialog/bg-right.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/basic-dialog/close.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/basic-dialog/collapse-over.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/basic-dialog/collapse.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/basic-dialog/e-handle.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/basic-dialog/expand-over.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/basic-dialog/expand.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/basic-dialog/hd-sprite.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/basic-dialog/s-handle.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/basic-dialog/se-handle.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/basic-dialog/w-handle.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/gradient-bg.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/grid/grid-blue-split.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/grid/grid-hrow.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/grid/grid-split.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/grid/grid-vista-hd.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/grid/pspbrwse.jbf +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/grid/sort-col-bg.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/grid/sort_asc.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/grid/sort_desc.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/layout/collapse.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/layout/expand.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/layout/gradient-bg.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/layout/ns-collapse.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/layout/ns-expand.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/layout/panel-close.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/layout/panel-title-bg.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/layout/panel-title-light-bg.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/layout/tab-close-on.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/layout/tab-close.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/qtip/bg.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/s.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/sizer/e-handle-dark.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/sizer/e-handle.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/sizer/ne-handle-dark.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/sizer/ne-handle.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/sizer/nw-handle-dark.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/sizer/nw-handle.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/sizer/s-handle-dark.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/sizer/s-handle.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/sizer/se-handle-dark.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/sizer/se-handle.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/sizer/sw-handle-dark.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/sizer/sw-handle.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/tabs/tab-btm-inactive-left-bg.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/tabs/tab-btm-inactive-right-bg.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/tabs/tab-btm-left-bg.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/tabs/tab-btm-right-bg.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/tabs/tab-sprite.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/tabs/tab-strip-bg.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/tabs/tab-strip-bg.png +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/tabs/tab-strip-btm-bg.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/toolbar/bg.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/aero/toolbar/tb-btn-sprite.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/basic-dialog/btn-arrow.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/basic-dialog/btn-sprite.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/basic-dialog/close.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/basic-dialog/collapse.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/basic-dialog/e-handle.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/basic-dialog/expand.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/basic-dialog/hd-sprite.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/basic-dialog/progress.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/basic-dialog/progress2.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/basic-dialog/s-handle.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/basic-dialog/se-handle.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/box/corners-blue.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/box/corners.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/box/l-blue.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/box/l.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/box/r-blue.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/box/r.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/box/tb-blue.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/box/tb.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/dd/drop-add.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/dd/drop-no.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/dd/drop-yes.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/form/date-trigger.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/form/error-tip-corners.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/form/exclamation.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/form/text-bg.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/form/trigger.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/gradient-bg.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/grid/Thumbs.db +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/grid/arrow-left-white.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/grid/arrow-right-white.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/grid/col-move-bottom.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/grid/col-move-top.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/grid/dirty.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/grid/done.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/grid/drop-no.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/grid/drop-yes.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/grid/footer-bg.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/grid/grid-blue-hd.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/grid/grid-blue-split.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/grid/grid-hrow.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/grid/grid-loading.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/grid/grid-split.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/grid/grid-vista-hd.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/grid/hd-pop.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/grid/hmenu-asc.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/grid/hmenu-desc.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/grid/hmenu-lock.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/grid/hmenu-lock.png +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/grid/hmenu-unlock.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/grid/hmenu-unlock.png +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/grid/invalid_line.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/grid/loading.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/grid/mso-hd.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/grid/nowait.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/grid/page-first-disabled.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/grid/page-first.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/grid/page-last-disabled.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/grid/page-last.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/grid/page-next-disabled.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/grid/page-next.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/grid/page-prev-disabled.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/grid/page-prev.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/grid/pick-button.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/grid/refresh.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/grid/sort_asc.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/grid/sort_desc.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/grid/wait.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/layout/collapse.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/layout/expand.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/layout/gradient-bg.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/layout/ns-collapse.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/layout/ns-expand.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/layout/panel-close.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/layout/panel-title-bg.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/layout/panel-title-light-bg.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/layout/stick.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/layout/stuck.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/layout/tab-close-on.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/layout/tab-close.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/menu/checked.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/menu/group-checked.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/menu/menu-parent.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/menu/menu.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/menu/unchecked.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/qtip/bg.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/qtip/close.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/qtip/tip-sprite.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/s.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/shadow-c.png +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/shadow-lr.png +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/shadow.png +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/shared/calendar.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/shared/left-btn.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/shared/right-btn.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/shared/warning.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/sizer/e-handle-dark.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/sizer/e-handle.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/sizer/ne-handle-dark.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/sizer/ne-handle.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/sizer/nw-handle-dark.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/sizer/nw-handle.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/sizer/s-handle-dark.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/sizer/s-handle.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/sizer/se-handle-dark.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/sizer/se-handle.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/sizer/square.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/sizer/sw-handle-dark.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/sizer/sw-handle.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/tabs/tab-btm-inactive-left-bg.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/tabs/tab-btm-inactive-right-bg.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/tabs/tab-btm-left-bg.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/tabs/tab-btm-right-bg.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/tabs/tab-sprite.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/toolbar/btn-arrow-light.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/toolbar/btn-arrow.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/toolbar/btn-over-bg.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/toolbar/gray-bg.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/toolbar/tb-bg.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/toolbar/tb-btn-sprite.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/tree/drop-add.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/tree/drop-between.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/tree/drop-no.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/tree/drop-over.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/tree/drop-under.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/tree/drop-yes.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/tree/elbow-end-minus-nl.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/tree/elbow-end-minus.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/tree/elbow-end-plus-nl.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/tree/elbow-end-plus.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/tree/elbow-end.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/tree/elbow-line.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/tree/elbow-minus-nl.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/tree/elbow-minus.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/tree/elbow-plus-nl.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/tree/elbow-plus.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/tree/elbow.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/tree/folder-open.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/tree/folder.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/tree/leaf.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/tree/loading.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/default/tree/s.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/gray/basic-dialog/close.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/gray/basic-dialog/collapse.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/gray/basic-dialog/dlg-bg.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/gray/basic-dialog/e-handle.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/gray/basic-dialog/expand.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/gray/basic-dialog/hd-sprite.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/gray/basic-dialog/s-handle.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/gray/basic-dialog/se-handle.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/gray/gradient-bg.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/gray/grid/grid-hrow.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/gray/layout/collapse.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/gray/layout/expand.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/gray/layout/gradient-bg.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/gray/layout/ns-collapse.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/gray/layout/ns-expand.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/gray/layout/panel-close.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/gray/layout/panel-title-bg.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/gray/layout/panel-title-light-bg.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/gray/layout/stick.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/gray/layout/tab-close-on.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/gray/layout/tab-close.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/gray/menu/checked.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/gray/menu/group-checked.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/gray/menu/menu-parent.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/gray/menu/menu.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/gray/menu/unchecked.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/gray/qtip/bg.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/gray/qtip/tip-sprite.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/gray/s.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/gray/sizer/e-handle-dark.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/gray/sizer/e-handle.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/gray/sizer/ne-handle-dark.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/gray/sizer/ne-handle.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/gray/sizer/nw-handle-dark.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/gray/sizer/nw-handle.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/gray/sizer/s-handle-dark.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/gray/sizer/s-handle.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/gray/sizer/se-handle-dark.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/gray/sizer/se-handle.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/gray/sizer/sw-handle-dark.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/gray/sizer/sw-handle.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/gray/tabs/tab-btm-inactive-left-bg.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/gray/tabs/tab-btm-inactive-right-bg.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/gray/tabs/tab-btm-left-bg.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/gray/tabs/tab-btm-right-bg.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/gray/tabs/tab-sprite.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/gray/toolbar/gray-bg.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/gray/toolbar/tb-btn-sprite.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/vista/basic-dialog/bg-center.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/vista/basic-dialog/bg-left.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/vista/basic-dialog/bg-right.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/vista/basic-dialog/close.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/vista/basic-dialog/collapse.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/vista/basic-dialog/dlg-bg.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/vista/basic-dialog/e-handle.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/vista/basic-dialog/expand.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/vista/basic-dialog/hd-sprite.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/vista/basic-dialog/s-handle.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/vista/basic-dialog/se-handle.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/vista/basic-dialog/w-handle.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/vista/gradient-bg.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/vista/grid/grid-split.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/vista/grid/grid-vista-hd.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/vista/layout/collapse.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/vista/layout/expand.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/vista/layout/gradient-bg.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/vista/layout/ns-collapse.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/vista/layout/ns-expand.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/vista/layout/panel-close.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/vista/layout/panel-title-bg.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/vista/layout/panel-title-light-bg.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/vista/layout/stick.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/vista/layout/tab-close-on.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/vista/layout/tab-close.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/vista/qtip/bg.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/vista/qtip/tip-sprite.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/vista/s.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/vista/sizer/e-handle-dark.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/vista/sizer/e-handle.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/vista/sizer/ne-handle-dark.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/vista/sizer/ne-handle.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/vista/sizer/nw-handle-dark.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/vista/sizer/nw-handle.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/vista/sizer/s-handle-dark.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/vista/sizer/s-handle.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/vista/sizer/se-handle-dark.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/vista/sizer/se-handle.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/vista/sizer/sw-handle-dark.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/vista/sizer/sw-handle.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/vista/tabs/tab-btm-inactive-left-bg.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/vista/tabs/tab-btm-inactive-right-bg.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/vista/tabs/tab-btm-left-bg.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/vista/tabs/tab-btm-right-bg.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/vista/tabs/tab-sprite.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/vista/toolbar/gray-bg.gif +0 -0
- data/lib/bloggit/client/scripts/resources/images/vista/toolbar/tb-btn-sprite.gif +0 -0
- data/lib/bloggit/client/scripts/resources/license.txt +25 -0
- data/lib/bloggit/client/scripts/resources/raw-images/shadow.psd +0 -0
- data/lib/bloggit/client/scripts/resources/resources.jsb +522 -0
- data/lib/bloggit/client/templates/json.rhtml +5 -0
- data/lib/bloggit/client/templates/main.rhtml +109 -0
- data/lib/bloggit/commandline.rb +52 -0
- data/lib/bloggit/commands/page_cmd.rb +17 -0
- data/lib/bloggit/commands/plugin_cmd.rb +89 -0
- data/lib/bloggit/commands/post_cmd.rb +17 -0
- data/lib/bloggit/commands/site_cmd.rb +82 -0
- data/lib/bloggit/commands/theme_cmd.rb +16 -0
- data/lib/bloggit/etc/hash.rb +24 -0
- data/lib/bloggit/etc/string.rb +5 -0
- data/lib/bloggit/generator.rb +331 -0
- data/lib/bloggit/hooks.rb +21 -0
- data/lib/bloggit/media.rb +40 -0
- data/lib/bloggit/page.rb +98 -0
- data/lib/bloggit/plugin.rb +52 -0
- data/lib/bloggit/post.rb +169 -0
- data/lib/bloggit/publisher.rb +115 -0
- data/lib/bloggit/server.rb +102 -0
- data/lib/bloggit/site.rb +183 -0
- data/lib/bloggit/tag.rb +61 -0
- data/lib/bloggit/tasks/client.rb +9 -0
- data/lib/bloggit/tasks/publishing.rb +36 -0
- data/lib/bloggit/tasks/scm.rb +78 -0
- data/lib/bloggit/tasks/specs.rb +128 -0
- data/lib/bloggit/template.rb +334 -0
- data/lib/bloggit/text_formatter.rb +50 -0
- data/lib/util/fixed_hoe.rb +553 -0
- data/test/fixtures/test.blog/Rakefile +7 -0
- data/test/fixtures/test.blog/pages/about.page +7 -0
- data/test/fixtures/test.blog/pages/coming-soon.page +3 -0
- data/test/fixtures/test.blog/pages/todo.page +23 -0
- data/test/fixtures/test.blog/plugins/example/init.rb +69 -0
- data/test/fixtures/test.blog/plugins/haloscan/init.rb +25 -0
- data/test/fixtures/test.blog/plugins/js_search/init.rb +51 -0
- data/test/fixtures/test.blog/plugins/rdoc_formatter/init.rb +14 -0
- data/test/fixtures/test.blog/posts/2004.03.07_to-boldly-go.post +11 -0
- data/test/fixtures/test.blog/posts/2007.03.25_sure-whatever.post +10 -0
- data/test/fixtures/test.blog/posts/2007.03.27_rdoc-anyone.post +13 -0
- data/test/fixtures/test.blog/posts/2010.12.07_35-already.post +5 -0
- data/test/fixtures/test.blog/settings.yml +34 -0
- data/test/fixtures/test.blog/themes/default/styles/main.css +145 -0
- data/test/fixtures/test.blog/themes/default/templates/archive.rhtml +22 -0
- data/test/fixtures/test.blog/themes/default/templates/home.rhtml +9 -0
- data/test/fixtures/test.blog/themes/default/templates/layouts/main.rhtml +17 -0
- data/test/fixtures/test.blog/themes/default/templates/layouts/two-columns.rhtml +21 -0
- data/test/fixtures/test.blog/themes/default/templates/page.rhtml +8 -0
- data/test/fixtures/test.blog/themes/default/templates/post.rhtml +15 -0
- data/test/fixtures/test.blog/themes/default/templates/snippets/blog_entry.rhtml +10 -0
- data/test/fixtures/test.blog/themes/default/templates/snippets/navigation.rhtml +12 -0
- data/test/fixtures/test.blog/themes/default/templates/snippets/tag_list.rhtml +9 -0
- data/test/fixtures/test.blog/themes/default/templates/tag_archive.rhtml +41 -0
- data/test/helpers.rb +25 -0
- data/test/unit/bloggit_test.rb +9 -0
- data/test/unit/page_test.rb +28 -0
- data/test/unit/post_test.rb +36 -0
- data/test/unit/site_test.rb +27 -0
- data/test/unit/template_test.rb +21 -0
- data/test/unit/text_formatter_test.rb +43 -0
- metadata +520 -0
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
/* teal: #556666 */
|
|
2
|
+
/* darkgrey: #222222 */
|
|
3
|
+
/* orange: #F85000 */
|
|
4
|
+
/* lightblue: #DDEEEE */
|
|
5
|
+
BODY {
|
|
6
|
+
background: #222222;
|
|
7
|
+
margin: 0px;
|
|
8
|
+
padding: 0px;
|
|
9
|
+
font-family: "Helvetica", "Verdana", "Sans-Serif";
|
|
10
|
+
font-size: 16px;
|
|
11
|
+
}
|
|
12
|
+
.header {
|
|
13
|
+
background: #556666;
|
|
14
|
+
border-bottom: 6px solid #F85000;
|
|
15
|
+
padding: 10px 0px;
|
|
16
|
+
}
|
|
17
|
+
.header H1 {
|
|
18
|
+
color: #DDEEEE;
|
|
19
|
+
text-align: center;
|
|
20
|
+
margin: 0px;
|
|
21
|
+
padding: 0px;
|
|
22
|
+
}
|
|
23
|
+
.header H1 A {
|
|
24
|
+
color: #DDEEEE;
|
|
25
|
+
text-decoration: none;
|
|
26
|
+
}
|
|
27
|
+
.header H2 {
|
|
28
|
+
color: #444;
|
|
29
|
+
text-align: center;
|
|
30
|
+
margin: 0px;
|
|
31
|
+
padding: 0px;
|
|
32
|
+
font-size: 100%;
|
|
33
|
+
font-weight: normal;
|
|
34
|
+
}
|
|
35
|
+
.page {
|
|
36
|
+
color: #DDEEEE;
|
|
37
|
+
width: 700px;
|
|
38
|
+
margin: 0 auto;
|
|
39
|
+
padding: 20px 0px;
|
|
40
|
+
}
|
|
41
|
+
.sidebar {
|
|
42
|
+
float: right;
|
|
43
|
+
width: 190px;
|
|
44
|
+
}
|
|
45
|
+
.sidebar h3 {
|
|
46
|
+
color: #778888;
|
|
47
|
+
font-size: 120%;
|
|
48
|
+
text-shadow: 3px 3px 3px black;
|
|
49
|
+
padding: 0px;
|
|
50
|
+
margin: 0px;
|
|
51
|
+
}
|
|
52
|
+
.sidebar LI {
|
|
53
|
+
color: #DDEEEE;
|
|
54
|
+
margin-bottom: 10px;
|
|
55
|
+
margin-left: 0px;
|
|
56
|
+
padding-left: 0px;
|
|
57
|
+
}
|
|
58
|
+
.sidebar LI:hover {
|
|
59
|
+
color: #F85000;
|
|
60
|
+
}
|
|
61
|
+
.sidebar A {
|
|
62
|
+
color: #556666;
|
|
63
|
+
text-decoration: none;
|
|
64
|
+
border-bottom: 0px;
|
|
65
|
+
display: block;
|
|
66
|
+
}
|
|
67
|
+
.sidebar A:hover {
|
|
68
|
+
color: #DDEEEE;
|
|
69
|
+
}
|
|
70
|
+
.content {
|
|
71
|
+
width: 480px;
|
|
72
|
+
}
|
|
73
|
+
.entry {
|
|
74
|
+
text-shadow: 3px 2px 2px black;
|
|
75
|
+
margin-bottom: 30px;
|
|
76
|
+
padding-bottom: 30px;
|
|
77
|
+
border-bottom: 1px dotted #333;
|
|
78
|
+
}
|
|
79
|
+
.entry h3 {
|
|
80
|
+
color: white;
|
|
81
|
+
font-size: 190%;
|
|
82
|
+
text-shadow: 3px 3px 3px black;
|
|
83
|
+
padding: 0px;
|
|
84
|
+
margin: 0px;
|
|
85
|
+
}
|
|
86
|
+
.entry h3 A {
|
|
87
|
+
color: white;
|
|
88
|
+
text-decoration: none;
|
|
89
|
+
}
|
|
90
|
+
.entry h3 A:hover {
|
|
91
|
+
color: white;
|
|
92
|
+
background-color: #556666;
|
|
93
|
+
}
|
|
94
|
+
.entry .meta {
|
|
95
|
+
font-size: 80%;
|
|
96
|
+
color: #778888;
|
|
97
|
+
}
|
|
98
|
+
.entry .meta A {
|
|
99
|
+
color: #778888;
|
|
100
|
+
text-decoration:none;
|
|
101
|
+
}
|
|
102
|
+
.entry .meta A:hover {
|
|
103
|
+
color: white;
|
|
104
|
+
}
|
|
105
|
+
.entry .body {
|
|
106
|
+
line-height: 1.4em;
|
|
107
|
+
}
|
|
108
|
+
.entry .body A {
|
|
109
|
+
color: white;
|
|
110
|
+
text-decoration: none;
|
|
111
|
+
border-bottom: 1px dotted #556666;
|
|
112
|
+
padding: 0px 4px;
|
|
113
|
+
}
|
|
114
|
+
.entry .body A:hover {
|
|
115
|
+
background-color: #556666;
|
|
116
|
+
}
|
|
117
|
+
.entry .body I,
|
|
118
|
+
.entry .body EM,
|
|
119
|
+
.entry .body B,
|
|
120
|
+
.entry .body STRONG {
|
|
121
|
+
color: white;
|
|
122
|
+
}
|
|
123
|
+
.entry .body CODE {
|
|
124
|
+
background-color: #111;
|
|
125
|
+
}
|
|
126
|
+
.entry .body PRE {
|
|
127
|
+
background-color: #111;
|
|
128
|
+
width: 480px;
|
|
129
|
+
overflow: auto;
|
|
130
|
+
padding: 5px 10px;
|
|
131
|
+
}
|
|
132
|
+
.footer {
|
|
133
|
+
text-align: center;
|
|
134
|
+
color: #556666;
|
|
135
|
+
}
|
|
136
|
+
.footer A {
|
|
137
|
+
color: #556666;
|
|
138
|
+
text-decoration: none;
|
|
139
|
+
border-bottom: 1px dotted #556666;
|
|
140
|
+
padding: 0px 4px;
|
|
141
|
+
}
|
|
142
|
+
.footer A:hover {
|
|
143
|
+
color: white;
|
|
144
|
+
background-color: #556666;
|
|
145
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
layout: two-columns
|
|
2
|
+
--- |
|
|
3
|
+
|
|
4
|
+
<% if mode == :month %>
|
|
5
|
+
|
|
6
|
+
<% posts.each do |post| %>
|
|
7
|
+
<%= render :snippet=>'blog_entry', :post=>post, :from=>:archive %>
|
|
8
|
+
<% end %>
|
|
9
|
+
|
|
10
|
+
<% else %>
|
|
11
|
+
<div class="entry">
|
|
12
|
+
<div class="body">
|
|
13
|
+
<ul>
|
|
14
|
+
<% posts.each do |post| %>
|
|
15
|
+
<li><b><%= link_to post.title, :post=>post %></b> on <%= post.publish_date.to_s %></li>
|
|
16
|
+
<% end %>
|
|
17
|
+
</ul>
|
|
18
|
+
</div>
|
|
19
|
+
</div>
|
|
20
|
+
<% end %>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
--- |
|
|
2
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
|
3
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
4
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
|
5
|
+
<head>
|
|
6
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
|
7
|
+
<title><%= site.title %></title>
|
|
8
|
+
<meta name="Generator" content="Bloggit"/>
|
|
9
|
+
<link rel="StyleSheet" type="text/css" href="<%= url_for :style=>'main' %>"/>
|
|
10
|
+
<%= render :content_for=>:head %>
|
|
11
|
+
</head>
|
|
12
|
+
<body>
|
|
13
|
+
<%= content_for_layout %>
|
|
14
|
+
</body>
|
|
15
|
+
</html>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
layout: main
|
|
2
|
+
--- |
|
|
3
|
+
|
|
4
|
+
<div class="header">
|
|
5
|
+
<h1><%= link_to_home site.title %></h1>
|
|
6
|
+
<h2><%= site.subtitle %></h2>
|
|
7
|
+
</div>
|
|
8
|
+
|
|
9
|
+
<div class="page">
|
|
10
|
+
<div class="sidebar">
|
|
11
|
+
<%= render :snippet=>'navigation' %>
|
|
12
|
+
<%= render :content_for=>:sidebar %>
|
|
13
|
+
<%= render :snippet=>'tag_list', :tags=>site.tags %>
|
|
14
|
+
</div>
|
|
15
|
+
<div class="content">
|
|
16
|
+
<%= content_for_layout %>
|
|
17
|
+
</div>
|
|
18
|
+
<div class="footer">
|
|
19
|
+
© <%= site.author %>. All rights reserved.
|
|
20
|
+
</div>
|
|
21
|
+
</div>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
--- |
|
|
2
|
+
<%
|
|
3
|
+
tag_links = []
|
|
4
|
+
post.tags.each do |tag|
|
|
5
|
+
tag_links << link_to(tag, :tag=>tag)
|
|
6
|
+
end
|
|
7
|
+
%>
|
|
8
|
+
<div class="entry">
|
|
9
|
+
<h3><%= (from != :post) ? link_to(post.title, :post=>post) : post.title %></h3>
|
|
10
|
+
<div class="meta">
|
|
11
|
+
Posted <%= post.publish_date %>, tagged: <%= tag_links.join(', ') %>.
|
|
12
|
+
</div>
|
|
13
|
+
<div class="body">
|
|
14
|
+
<%= render :content=>post %>
|
|
15
|
+
</div>
|
|
16
|
+
</div>
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
layout: two-columns
|
|
2
|
+
--- |
|
|
3
|
+
<div class="entry">
|
|
4
|
+
<% if mode == :all_tags %>
|
|
5
|
+
|
|
6
|
+
<div class="body">
|
|
7
|
+
<% tags.each do |tag| %>
|
|
8
|
+
<span><%= tag.name %></span>
|
|
9
|
+
<% end %>
|
|
10
|
+
</div>
|
|
11
|
+
|
|
12
|
+
<% else %>
|
|
13
|
+
|
|
14
|
+
<% if tag.has_posts? %>
|
|
15
|
+
<h3>Posts tagged "<%= tag.name %>"</h3>
|
|
16
|
+
<div class="body">
|
|
17
|
+
|
|
18
|
+
<ul>
|
|
19
|
+
<% tag.posts.each do |post| %>
|
|
20
|
+
<li><b><%= link_to post.title, :post=>post %></b> on <%= post.publish_date.to_s %></li>
|
|
21
|
+
<% end %>
|
|
22
|
+
</ul>
|
|
23
|
+
</div>
|
|
24
|
+
<% end %>
|
|
25
|
+
<% if tag.has_pages? %>
|
|
26
|
+
|
|
27
|
+
<h3>Pages tagged with "<%= tag.name %>"</h3>
|
|
28
|
+
<div class="body">
|
|
29
|
+
<ul>
|
|
30
|
+
<% tag.pages.each do |page| %>
|
|
31
|
+
<li><b><%= link_to page.title, :page=>page %></b></li>
|
|
32
|
+
<% end %>
|
|
33
|
+
</ul>
|
|
34
|
+
</div>
|
|
35
|
+
<% end %>
|
|
36
|
+
|
|
37
|
+
<% end %>
|
|
38
|
+
</div>
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
require 'find'
|
|
2
|
+
|
|
3
|
+
module Bloggit
|
|
4
|
+
module Checksum
|
|
5
|
+
class << self
|
|
6
|
+
|
|
7
|
+
# returns [files_to_upload, files_to_delete]
|
|
8
|
+
def diff(source={}, target={})
|
|
9
|
+
# look for differences...
|
|
10
|
+
src_files = source.fetch('files', {})
|
|
11
|
+
tgt_files = target.fetch('files', {})
|
|
12
|
+
to_update = []; to_delete = []; to_upload = []
|
|
13
|
+
|
|
14
|
+
tgt_files.each do |filename, checksum|
|
|
15
|
+
if src_files.has_key? filename
|
|
16
|
+
to_update << filename unless src_files[filename] == checksum
|
|
17
|
+
else
|
|
18
|
+
to_delete << filename
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
to_upload = src_files.keys - tgt_files.keys
|
|
23
|
+
|
|
24
|
+
# returns [files_to_upload, files_to_delete]
|
|
25
|
+
[[to_upload, to_update].flatten, to_delete]
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
# Create the checksums...
|
|
29
|
+
def generate_from(cache_dir)
|
|
30
|
+
checksums = { 'generated_on'=>Time.now, 'files'=>{} }
|
|
31
|
+
Find.find( cache_dir ) do |f|
|
|
32
|
+
next if File.directory?( f )
|
|
33
|
+
checksums['files'][f.gsub("#{cache_dir}/", '')] = Digest::MD5.hexdigest( File.read(f) )
|
|
34
|
+
end
|
|
35
|
+
checksums
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
end
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Ext JS Library 1.0.1
|
|
3
|
+
* Copyright(c) 2006-2007, Ext JS, LLC.
|
|
4
|
+
* licensing@extjs.com
|
|
5
|
+
*
|
|
6
|
+
* http://www.extjs.com/license
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
Ext={};window["undefined"]=window["undefined"];Ext.apply=function(o,c,_3){if(_3){Ext.apply(o,_3);}if(o&&c&&typeof c=="object"){for(var p in c){o[p]=c[p];}}return o;};(function(){var _5=0;var ua=navigator.userAgent.toLowerCase();var _7=document.compatMode=="CSS1Compat",_8=ua.indexOf("opera")>-1,_9=(/webkit|khtml/).test(ua),_a=ua.indexOf("msie")>-1,_b=ua.indexOf("msie 7")>-1,_c=!_9&&ua.indexOf("gecko")>-1,_d=_a&&!_7,_e=(ua.indexOf("windows")!=-1||ua.indexOf("win32")!=-1),_f=(ua.indexOf("macintosh")!=-1||ua.indexOf("mac os x")!=-1),_10=window.location.href.toLowerCase().indexOf("https")===0;if(_a&&!_b){try{document.execCommand("BackgroundImageCache",false,true);}catch(e){}}Ext.apply(Ext,{isStrict:_7,isSecure:_10,isReady:false,SSL_SECURE_URL:"javascript:false",BLANK_IMAGE_URL:"http:/"+"/extjs.com/s.gif",emptyFn:function(){},applyIf:function(o,c){if(o&&c){for(var p in c){if(typeof o[p]=="undefined"){o[p]=c[p];}}}return o;},addBehaviors:function(o){if(!Ext.isReady){Ext.onReady(function(){Ext.addBehaviors(o);});return;}var _15={};for(var b in o){var _17=b.split("@");if(_17[1]){var s=_17[0];if(!_15[s]){_15[s]=Ext.select(s);}_15[s].on(_17[1],o[b]);}}_15=null;},id:function(el,_1a){_1a=_1a||"ext-gen";el=Ext.getDom(el);var id=_1a+(++_5);return el?(el.id?el.id:(el.id=id)):id;},extend:function(){var io=function(o){for(var m in o){this[m]=o[m];}};return function(sb,sp,_21){if(typeof sp=="object"){_21=sp;sp=sb;sb=function(){sp.apply(this,arguments);};}var F=function(){},sbp,spp=sp.prototype;F.prototype=spp;sbp=sb.prototype=new F();sbp.constructor=sb;sb.superclass=spp;if(spp.constructor==Object.prototype.constructor){spp.constructor=sp;}sb.override=function(o){Ext.override(sb,o);};sbp.override=io;sbp.__extcls=sb;Ext.override(sb,_21);return sb;};}(),override:function(_26,_27){if(_27){var p=_26.prototype;for(var _29 in _27){p[_29]=_27[_29];}}},namespace:function(){var a=arguments,o=null,i,j,d,rt;for(i=0;i<a.length;++i){d=a[i].split(".");rt=d[0];eval("if (typeof "+rt+" == \"undefined\"){"+rt+" = {};} o = "+rt+";");for(j=1;j<d.length;++j){o[d[j]]=o[d[j]]||{};o=o[d[j]];}}},urlEncode:function(o){if(!o){return "";}var buf=[];for(var key in o){var ov=o[key];var _34=typeof ov;if(_34=="undefined"){buf.push(encodeURIComponent(key),"=&");}else{if(_34!="function"&&_34!="object"){buf.push(encodeURIComponent(key),"=",encodeURIComponent(ov),"&");}else{if(ov instanceof Array){for(var i=0,len=ov.length;i<len;i++){buf.push(encodeURIComponent(key),"=",encodeURIComponent(ov[i]===undefined?"":ov[i]),"&");}}}}}buf.pop();return buf.join("");},urlDecode:function(_37,_38){if(!_37||!_37.length){return {};}var obj={};var _3a=_37.split("&");var _3b,_3c,_3d;for(var i=0,len=_3a.length;i<len;i++){_3b=_3a[i].split("=");_3c=decodeURIComponent(_3b[0]);_3d=decodeURIComponent(_3b[1]);if(_38!==true){if(typeof obj[_3c]=="undefined"){obj[_3c]=_3d;}else{if(typeof obj[_3c]=="string"){obj[_3c]=[obj[_3c]];obj[_3c].push(_3d);}else{obj[_3c].push(_3d);}}}else{obj[_3c]=_3d;}}return obj;},each:function(_40,fn,_42){if(typeof _40.length=="undefined"||typeof _40=="string"){_40=[_40];}for(var i=0,len=_40.length;i<len;i++){if(fn.call(_42||_40[i],_40[i],i,_40)===false){return i;}}},combine:function(){var as=arguments,l=as.length,r=[];for(var i=0;i<l;i++){var a=as[i];if(a instanceof Array){r=r.concat(a);}else{if(a.length!==undefined&&!a.substr){r=r.concat(Array.prototype.slice.call(a,0));}else{r.push(a);}}}return r;},escapeRe:function(s){return s.replace(/([.*+?^${}()|[\]\/\\])/g,"\\$1");},callback:function(cb,_4c,_4d,_4e){if(typeof cb=="function"){if(_4e){cb.defer(_4e,_4c,_4d||[]);}else{cb.apply(_4c,_4d||[]);}}},getDom:function(el){if(!el){return null;}return el.dom?el.dom:(typeof el=="string"?document.getElementById(el):el);},getCmp:function(id){return Ext.ComponentMgr.get(id);},num:function(v,_52){if(typeof v!="number"){return _52;}return v;},destroy:function(){for(var i=0,a=arguments,len=a.length;i<len;i++){var as=a[i];if(as){if(as.dom){as.removeAllListeners();as.remove();continue;}if(typeof as.purgeListeners=="function"){as.purgeListeners();}if(typeof as.destroy=="function"){as.destroy();}}}},isOpera:_8,isSafari:_9,isIE:_a,isIE7:_b,isGecko:_c,isBorderBox:_d,isWindows:_e,isMac:_f,useShims:((_a&&!_b)||(_c&&_f))});})();Ext.namespace("Ext","Ext.util","Ext.grid","Ext.dd","Ext.tree","Ext.data","Ext.form","Ext.menu","Ext.state","Ext.lib","Ext.layout");Ext.apply(Function.prototype,{createCallback:function(){var _57=arguments;var _58=this;return function(){return _58.apply(window,_57);};},createDelegate:function(obj,_5a,_5b){var _5c=this;return function(){var _5d=_5a||arguments;if(_5b===true){_5d=Array.prototype.slice.call(arguments,0);_5d=_5d.concat(_5a);}else{if(typeof _5b=="number"){_5d=Array.prototype.slice.call(arguments,0);var _5e=[_5b,0].concat(_5a);Array.prototype.splice.apply(_5d,_5e);}}return _5c.apply(obj||window,_5d);};},defer:function(_5f,obj,_61,_62){var fn=this.createDelegate(obj,_61,_62);if(_5f){return setTimeout(fn,_5f);}fn();return 0;},createSequence:function(fcn,_65){if(typeof fcn!="function"){return this;}var _66=this;return function(){var _67=_66.apply(this||window,arguments);fcn.apply(_65||this||window,arguments);return _67;};},createInterceptor:function(fcn,_69){if(typeof fcn!="function"){return this;}var _6a=this;return function(){fcn.target=this;fcn.method=_6a;if(fcn.apply(_69||this||window,arguments)===false){return;}return _6a.apply(this||window,arguments);};}});Ext.applyIf(String,{escape:function(_6b){return _6b.replace(/('|\\)/g,"\\$1");},leftPad:function(val,_6d,ch){var _6f=new String(val);if(ch==null){ch=" ";}while(_6f.length<_6d){_6f=ch+_6f;}return _6f;},format:function(_70){var _71=Array.prototype.slice.call(arguments,1);return _70.replace(/\{(\d+)\}/g,function(m,i){return _71[i];});}});String.prototype.toggle=function(_74,_75){return this==_74?_75:_74;};Ext.applyIf(Number.prototype,{constrain:function(min,max){return Math.min(Math.max(this,min),max);}});Ext.applyIf(Array.prototype,{indexOf:function(o){for(var i=0,len=this.length;i<len;i++){if(this[i]==o){return i;}}return -1;},remove:function(o){var _7c=this.indexOf(o);if(_7c!=-1){this.splice(_7c,1);}}});Date.prototype.getElapsed=function(_7d){return Math.abs((_7d||new Date()).getTime()-this.getTime());};
|
|
10
|
+
|
|
11
|
+
if(typeof jQuery=="undefined"){throw "Unable to load Ext, jQuery not found.";}(function(){Ext.lib.Dom={getViewWidth:function(_1){return _1?Math.max(jQuery(document).width(),jQuery(window).width()):jQuery(window).width();},getViewHeight:function(_2){return _2?Math.max(jQuery(document).height(),jQuery(window).height()):jQuery(window).height();},isAncestor:function(p,c){p=Ext.getDom(p);c=Ext.getDom(c);if(!p||!c){return false;}if(p.contains&&!Ext.isSafari){return p.contains(c);}else{if(p.compareDocumentPosition){return !!(p.compareDocumentPosition(c)&16);}else{var _5=c.parentNode;while(_5){if(_5==p){return true;}else{if(!_5.tagName||_5.tagName.toUpperCase()=="HTML"){return false;}}_5=_5.parentNode;}return false;}}},getRegion:function(el){return Ext.lib.Region.getRegion(el);},getY:function(el){return jQuery(el).offset({scroll:false}).top;},getX:function(el){return jQuery(el).offset({scroll:false}).left;},getXY:function(el){var o=jQuery(el).offset({scroll:false});return [o.left,o.top];},setXY:function(el,xy){el=Ext.fly(el,"_setXY");el.position();var _d=el.translatePoints(xy);if(xy[0]!==false){el.dom.style.left=_d.left+"px";}if(xy[1]!==false){el.dom.style.top=_d.top+"px";}},setX:function(el,x){this.setXY(el,[x,false]);},setY:function(el,y){this.setXY(el,[false,y]);}};Ext.lib.Event={getPageX:function(e){e=e.browserEvent||e;return e.pageX;},getPageY:function(e){e=e.browserEvent||e;return e.pageY;},getXY:function(e){e=e.browserEvent||e;return [e.pageX,e.pageY];},getTarget:function(e){return e.target;},on:function(el,_17,fn,_19,_1a){jQuery(el).bind(_17,fn);},un:function(el,_1c,fn){jQuery(el).unbind(_1c,fn);},purgeElement:function(el){jQuery(el).unbind();},preventDefault:function(e){e=e.browserEvent||e;e.preventDefault();},stopPropagation:function(e){e=e.browserEvent||e;e.stopPropagation();},stopEvent:function(e){e=e.browserEvent||e;e.preventDefault();e.stopPropagation();},onAvailable:function(id,fn,_24){var _25=new Date();var f=function(){if(_25.getElapsed()>10000){clearInterval(iid);}var el=document.getElementById(id);if(el){clearInterval(iid);fn.call(_24||window,el);}};var iid=setInterval(f,50);},resolveTextNode:function(_29){if(_29&&3==_29.nodeType){return _29.parentNode;}else{return _29;}},getRelatedTarget:function(ev){ev=ev.browserEvent||ev;var t=ev.relatedTarget;if(!t){if(ev.type=="mouseout"){t=ev.toElement;}else{if(ev.type=="mouseover"){t=ev.fromElement;}}}return this.resolveTextNode(t);}};Ext.lib.Ajax=function(){var _2c=function(cb){return function(xhr,_2f){if((_2f=="error"||_2f=="timeout")&&cb.failure){cb.failure.call(cb.scope||window,{responseText:xhr.responseText,responseXML:xhr.responseXML,argument:cb.argument});}else{if(cb.success){cb.success.call(cb.scope||window,{responseText:xhr.responseText,responseXML:xhr.responseXML,argument:cb.argument});}}};};return {request:function(_30,uri,cb,_33){jQuery.ajax({type:_30,url:uri,data:_33,timeout:cb.timeout,complete:_2c(cb)});},formRequest:function(_34,uri,cb,_37,_38,_39){jQuery.ajax({type:Ext.getDom(_34).method||"POST",url:uri,data:jQuery(_34).formSerialize()+(_37?"&"+_37:""),timeout:cb.timeout,complete:_2c(cb)});},isCallInProgress:function(_3a){return false;},abort:function(_3b){return false;},serializeForm:function(_3c){return jQuery(_3c.dom||_3c).formSerialize();}};}();Ext.lib.Anim=function(){var _3d=function(cb,_3f){var _40=true;return {stop:function(_41){},isAnimated:function(){return _40;},proxyCallback:function(){_40=false;Ext.callback(cb,_3f);}};};return {scroll:function(el,_43,_44,_45,cb,_47){var _48=_3d(cb,_47);el=Ext.getDom(el);el.scrollLeft=_43.scroll.to[0];el.scrollTop=_43.scroll.to[1];_48.proxyCallback();return _48;},motion:function(el,_4a,_4b,_4c,cb,_4e){return this.run(el,_4a,_4b,_4c,cb,_4e);},color:function(el,_50,_51,_52,cb,_54){var _55=_3d(cb,_54);_55.proxyCallback();return _55;},run:function(el,_57,_58,_59,cb,_5b,_5c){var _5d=_3d(cb,_5b);var o={};for(var k in _57){switch(k){case "points":var by,pts,e=Ext.fly(el,"_animrun");e.position();if(by=_57.points.by){var xy=e.getXY();pts=e.translatePoints([xy[0]+by[0],xy[1]+by[1]]);}else{pts=e.translatePoints(_57.points.to);}o.left=pts.left;o.top=pts.top;if(!parseInt(e.getStyle("left"),10)){e.setLeft(0);}if(!parseInt(e.getStyle("top"),10)){e.setTop(0);}break;case "width":o.width=_57.width.to;break;case "height":o.height=_57.height.to;break;case "opacity":o.opacity=_57.opacity.to;break;default:o[k]=_57[k].to;break;}}jQuery(el).animate(o,_58*1000,undefined,_5d.proxyCallback);return _5d;}};}();Ext.lib.Region=function(t,r,b,l){this.top=t;this[1]=t;this.right=r;this.bottom=b;this.left=l;this[0]=l;};Ext.lib.Region.prototype={contains:function(_68){return (_68.left>=this.left&&_68.right<=this.right&&_68.top>=this.top&&_68.bottom<=this.bottom);},getArea:function(){return ((this.bottom-this.top)*(this.right-this.left));},intersect:function(_69){var t=Math.max(this.top,_69.top);var r=Math.min(this.right,_69.right);var b=Math.min(this.bottom,_69.bottom);var l=Math.max(this.left,_69.left);if(b>=t&&r>=l){return new Ext.lib.Region(t,r,b,l);}else{return null;}},union:function(_6e){var t=Math.min(this.top,_6e.top);var r=Math.max(this.right,_6e.right);var b=Math.max(this.bottom,_6e.bottom);var l=Math.min(this.left,_6e.left);return new Ext.lib.Region(t,r,b,l);},adjust:function(t,l,b,r){this.top+=t;this.left+=l;this.right+=r;this.bottom+=b;return this;}};Ext.lib.Region.getRegion=function(el){var p=Ext.lib.Dom.getXY(el);var t=p[1];var r=p[0]+el.offsetWidth;var b=p[1]+el.offsetHeight;var l=p[0];return new Ext.lib.Region(t,r,b,l);};Ext.lib.Point=function(x,y){if(x instanceof Array){y=x[1];x=x[0];}this.x=this.right=this.left=this[0]=x;this.y=this.top=this.bottom=this[1]=y;};Ext.lib.Point.prototype=new Ext.lib.Region();if(Ext.isIE){jQuery(window).unload(function(){var p=Function.prototype;delete p.createSequence;delete p.defer;delete p.createDelegate;delete p.createCallback;delete p.createInterceptor;});}})();
|
|
12
|
+
|
|
@@ -0,0 +1,965 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Ext - JS Library 1.0 Alpha 2
|
|
3
|
+
* Copyright(c) 2006-2007, Jack Slocum.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/*
|
|
7
|
+
* Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
|
|
8
|
+
* and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
|
|
9
|
+
*
|
|
10
|
+
* $LastChangedDate$
|
|
11
|
+
* $Rev$
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
jQuery.fn._height = jQuery.fn.height;
|
|
15
|
+
jQuery.fn._width = jQuery.fn.width;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* If used on document, returns the document's height (innerHeight)
|
|
19
|
+
* If used on window, returns the viewport's (window) height
|
|
20
|
+
* See core docs on height() to see what happens when used on an element.
|
|
21
|
+
*
|
|
22
|
+
* @example $("#testdiv").height()
|
|
23
|
+
* @result 200
|
|
24
|
+
*
|
|
25
|
+
* @example $(document).height()
|
|
26
|
+
* @result 800
|
|
27
|
+
*
|
|
28
|
+
* @example $(window).height()
|
|
29
|
+
* @result 400
|
|
30
|
+
*
|
|
31
|
+
* @name height
|
|
32
|
+
* @type Object
|
|
33
|
+
* @cat Plugins/Dimensions
|
|
34
|
+
*/
|
|
35
|
+
jQuery.fn.height = function() {
|
|
36
|
+
if ( this[0] == window )
|
|
37
|
+
return self.innerHeight ||
|
|
38
|
+
jQuery.boxModel && document.documentElement.clientHeight ||
|
|
39
|
+
document.body.clientHeight;
|
|
40
|
+
|
|
41
|
+
if ( this[0] == document )
|
|
42
|
+
return Math.max( document.body.scrollHeight, document.body.offsetHeight );
|
|
43
|
+
|
|
44
|
+
return this._height(arguments[0]);
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* If used on document, returns the document's width (innerWidth)
|
|
49
|
+
* If used on window, returns the viewport's (window) width
|
|
50
|
+
* See core docs on height() to see what happens when used on an element.
|
|
51
|
+
*
|
|
52
|
+
* @example $("#testdiv").width()
|
|
53
|
+
* @result 200
|
|
54
|
+
*
|
|
55
|
+
* @example $(document).width()
|
|
56
|
+
* @result 800
|
|
57
|
+
*
|
|
58
|
+
* @example $(window).width()
|
|
59
|
+
* @result 400
|
|
60
|
+
*
|
|
61
|
+
* @name width
|
|
62
|
+
* @type Object
|
|
63
|
+
* @cat Plugins/Dimensions
|
|
64
|
+
*/
|
|
65
|
+
jQuery.fn.width = function() {
|
|
66
|
+
if ( this[0] == window )
|
|
67
|
+
return self.innerWidth ||
|
|
68
|
+
jQuery.boxModel && document.documentElement.clientWidth ||
|
|
69
|
+
document.body.clientWidth;
|
|
70
|
+
|
|
71
|
+
if ( this[0] == document )
|
|
72
|
+
return Math.max( document.body.scrollWidth, document.body.offsetWidth );
|
|
73
|
+
|
|
74
|
+
return this._width(arguments[0]);
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Returns the inner height value (without border) for the first matched element.
|
|
79
|
+
* If used on document, returns the document's height (innerHeight)
|
|
80
|
+
* If used on window, returns the viewport's (window) height
|
|
81
|
+
*
|
|
82
|
+
* @example $("#testdiv").innerHeight()
|
|
83
|
+
* @result 800
|
|
84
|
+
*
|
|
85
|
+
* @name innerHeight
|
|
86
|
+
* @type Number
|
|
87
|
+
* @cat Plugins/Dimensions
|
|
88
|
+
*/
|
|
89
|
+
jQuery.fn.innerHeight = function() {
|
|
90
|
+
return this[0] == window || this[0] == document ?
|
|
91
|
+
this.height() :
|
|
92
|
+
this.css('display') != 'none' ?
|
|
93
|
+
this[0].offsetHeight - (parseInt(this.css("borderTopWidth")) || 0) - (parseInt(this.css("borderBottomWidth")) || 0) :
|
|
94
|
+
this.height() + (parseInt(this.css("paddingTop")) || 0) + (parseInt(this.css("paddingBottom")) || 0);
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Returns the inner width value (without border) for the first matched element.
|
|
99
|
+
* If used on document, returns the document's Width (innerWidth)
|
|
100
|
+
* If used on window, returns the viewport's (window) width
|
|
101
|
+
*
|
|
102
|
+
* @example $("#testdiv").innerWidth()
|
|
103
|
+
* @result 1000
|
|
104
|
+
*
|
|
105
|
+
* @name innerWidth
|
|
106
|
+
* @type Number
|
|
107
|
+
* @cat Plugins/Dimensions
|
|
108
|
+
*/
|
|
109
|
+
jQuery.fn.innerWidth = function() {
|
|
110
|
+
return this[0] == window || this[0] == document ?
|
|
111
|
+
this.width() :
|
|
112
|
+
this.css('display') != 'none' ?
|
|
113
|
+
this[0].offsetWidth - (parseInt(this.css("borderLeftWidth")) || 0) - (parseInt(this.css("borderRightWidth")) || 0) :
|
|
114
|
+
this.height() + (parseInt(this.css("paddingLeft")) || 0) + (parseInt(this.css("paddingRight")) || 0);
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Returns the outer height value (including border) for the first matched element.
|
|
119
|
+
* Cannot be used on document or window.
|
|
120
|
+
*
|
|
121
|
+
* @example $("#testdiv").outerHeight()
|
|
122
|
+
* @result 1000
|
|
123
|
+
*
|
|
124
|
+
* @name outerHeight
|
|
125
|
+
* @type Number
|
|
126
|
+
* @cat Plugins/Dimensions
|
|
127
|
+
*/
|
|
128
|
+
jQuery.fn.outerHeight = function() {
|
|
129
|
+
return this[0] == window || this[0] == document ?
|
|
130
|
+
this.height() :
|
|
131
|
+
this.css('display') != 'none' ?
|
|
132
|
+
this[0].offsetHeight :
|
|
133
|
+
this.height() + (parseInt(this.css("borderTopWidth")) || 0) + (parseInt(this.css("borderBottomWidth")) || 0)
|
|
134
|
+
+ (parseInt(this.css("paddingTop")) || 0) + (parseInt(this.css("paddingBottom")) || 0);
|
|
135
|
+
};
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* Returns the outer width value (including border) for the first matched element.
|
|
139
|
+
* Cannot be used on document or window.
|
|
140
|
+
*
|
|
141
|
+
* @example $("#testdiv").outerWidth()
|
|
142
|
+
* @result 1000
|
|
143
|
+
*
|
|
144
|
+
* @name outerWidth
|
|
145
|
+
* @type Number
|
|
146
|
+
* @cat Plugins/Dimensions
|
|
147
|
+
*/
|
|
148
|
+
jQuery.fn.outerWidth = function() {
|
|
149
|
+
return this[0] == window || this[0] == document ?
|
|
150
|
+
this.width() :
|
|
151
|
+
this.css('display') != 'none' ?
|
|
152
|
+
this[0].offsetWidth :
|
|
153
|
+
this.height() + (parseInt(this.css("borderLeftWidth")) || 0) + (parseInt(this.css("borderRightWidth")) || 0)
|
|
154
|
+
+ (parseInt(this.css("paddingLeft")) || 0) + (parseInt(this.css("paddingRight")) || 0);
|
|
155
|
+
};
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* Returns how many pixels the user has scrolled to the right (scrollLeft).
|
|
159
|
+
* Works on containers with overflow: auto and window/document.
|
|
160
|
+
*
|
|
161
|
+
* @example $("#testdiv").scrollLeft()
|
|
162
|
+
* @result 100
|
|
163
|
+
*
|
|
164
|
+
* @name scrollLeft
|
|
165
|
+
* @type Number
|
|
166
|
+
* @cat Plugins/Dimensions
|
|
167
|
+
*/
|
|
168
|
+
jQuery.fn.scrollLeft = function() {
|
|
169
|
+
if ( this[0] == window || this[0] == document )
|
|
170
|
+
return self.pageXOffset ||
|
|
171
|
+
jQuery.boxModel && document.documentElement.scrollLeft ||
|
|
172
|
+
document.body.scrollLeft;
|
|
173
|
+
|
|
174
|
+
return this[0].scrollLeft;
|
|
175
|
+
};
|
|
176
|
+
|
|
177
|
+
/**
|
|
178
|
+
* Returns how many pixels the user has scrolled to the bottom (scrollTop).
|
|
179
|
+
* Works on containers with overflow: auto and window/document.
|
|
180
|
+
*
|
|
181
|
+
* @example $("#testdiv").scrollTop()
|
|
182
|
+
* @result 100
|
|
183
|
+
*
|
|
184
|
+
* @name scrollTop
|
|
185
|
+
* @type Number
|
|
186
|
+
* @cat Plugins/Dimensions
|
|
187
|
+
*/
|
|
188
|
+
jQuery.fn.scrollTop = function() {
|
|
189
|
+
if ( this[0] == window || this[0] == document )
|
|
190
|
+
return self.pageYOffset ||
|
|
191
|
+
jQuery.boxModel && document.documentElement.scrollTop ||
|
|
192
|
+
document.body.scrollTop;
|
|
193
|
+
|
|
194
|
+
return this[0].scrollTop;
|
|
195
|
+
};
|
|
196
|
+
|
|
197
|
+
/**
|
|
198
|
+
* Returns the location of the element in pixels from the top left corner of the viewport.
|
|
199
|
+
*
|
|
200
|
+
* For accurate readings make sure to use pixel values for margins, borders and padding.
|
|
201
|
+
*
|
|
202
|
+
* @example $("#testdiv").offset()
|
|
203
|
+
* @result { top: 100, left: 100, scrollTop: 10, scrollLeft: 10 }
|
|
204
|
+
*
|
|
205
|
+
* @example $("#testdiv").offset({ scroll: false })
|
|
206
|
+
* @result { top: 90, left: 90 }
|
|
207
|
+
*
|
|
208
|
+
* @example var offset = {}
|
|
209
|
+
* $("#testdiv").offset({ scroll: false }, offset)
|
|
210
|
+
* @result offset = { top: 90, left: 90 }
|
|
211
|
+
*
|
|
212
|
+
* @name offset
|
|
213
|
+
* @param Object options A hash of options describing what should be included in the final calculations of the offset.
|
|
214
|
+
* The options include:
|
|
215
|
+
* margin: Should the margin of the element be included in the calculations? True by default.
|
|
216
|
+
* If set to false the margin of the element is subtracted from the total offset.
|
|
217
|
+
* border: Should the border of the element be included in the calculations? True by default.
|
|
218
|
+
* If set to false the border of the element is subtracted from the total offset.
|
|
219
|
+
* padding: Should the padding of the element be included in the calculations? False by default.
|
|
220
|
+
* If set to true the padding of the element is added to the total offset.
|
|
221
|
+
* scroll: Should the scroll offsets of the parent elements be included in the calculations?
|
|
222
|
+
* True by default. When true, it adds the total scroll offsets of all parents to the
|
|
223
|
+
* total offset and also adds two properties to the returned object, scrollTop and
|
|
224
|
+
* scrollLeft. If set to false the scroll offsets of parent elements are ignored.
|
|
225
|
+
* If scroll offsets are not needed, set to false to get a performance boost.
|
|
226
|
+
* @param Object returnObject An object to store the return value in, so as not to break the chain. If passed in the
|
|
227
|
+
* chain will not be broken and the result will be assigned to this object.
|
|
228
|
+
* @type Object
|
|
229
|
+
* @cat Plugins/Dimensions
|
|
230
|
+
* @author Brandon Aaron (brandon.aaron@gmail.com || http://brandonaaron.net)
|
|
231
|
+
*/
|
|
232
|
+
jQuery.fn.offset = function(options, returnObject) {
|
|
233
|
+
var x = 0, y = 0, elem = this[0], parent = this[0], sl = 0, st = 0, options = jQuery.extend({ margin: true, border: true, padding: false, scroll: true }, options || {});
|
|
234
|
+
do {
|
|
235
|
+
x += parent.offsetLeft || 0;
|
|
236
|
+
y += parent.offsetTop || 0;
|
|
237
|
+
|
|
238
|
+
// Mozilla and IE do not add the border
|
|
239
|
+
if (jQuery.browser.mozilla || jQuery.browser.msie) {
|
|
240
|
+
// get borders
|
|
241
|
+
var bt = parseInt(jQuery.css(parent, 'borderTopWidth')) || 0;
|
|
242
|
+
var bl = parseInt(jQuery.css(parent, 'borderLeftWidth')) || 0;
|
|
243
|
+
|
|
244
|
+
// add borders to offset
|
|
245
|
+
x += bl;
|
|
246
|
+
y += bt;
|
|
247
|
+
|
|
248
|
+
// Mozilla removes the border if the parent has overflow property other than visible
|
|
249
|
+
if (jQuery.browser.mozilla && parent != elem && jQuery.css(parent, 'overflow') != 'visible') {
|
|
250
|
+
x += bl;
|
|
251
|
+
y += bt;
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
var op = parent.offsetParent;
|
|
256
|
+
if (op && (op.tagName == 'BODY' || op.tagName == 'HTML')) {
|
|
257
|
+
// Safari doesn't add the body margin for elments positioned with static or relative
|
|
258
|
+
if (jQuery.browser.safari && jQuery.css(parent, 'position') != 'absolute') {
|
|
259
|
+
x += parseInt(jQuery.css(op, 'marginLeft')) || 0;
|
|
260
|
+
y += parseInt(jQuery.css(op, 'marginTop')) || 0;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
// Exit the loop
|
|
264
|
+
break;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
if (options.scroll) {
|
|
268
|
+
// Need to get scroll offsets in-between offsetParents
|
|
269
|
+
do {
|
|
270
|
+
sl += parent.scrollLeft || 0;
|
|
271
|
+
st += parent.scrollTop || 0;
|
|
272
|
+
|
|
273
|
+
parent = parent.parentNode;
|
|
274
|
+
|
|
275
|
+
// Mozilla removes the border if the parent has overflow property other than visible
|
|
276
|
+
if (jQuery.browser.mozilla && parent != elem && parent != op && parent.style && jQuery.css(parent, 'overflow') != 'visible') {
|
|
277
|
+
y += parseInt(jQuery.css(parent, 'borderTopWidth')) || 0;
|
|
278
|
+
x += parseInt(jQuery.css(parent, 'borderLeftWidth')) || 0;
|
|
279
|
+
}
|
|
280
|
+
} while (parent != op);
|
|
281
|
+
} else {
|
|
282
|
+
parent = parent.offsetParent;
|
|
283
|
+
}
|
|
284
|
+
} while (parent);
|
|
285
|
+
|
|
286
|
+
if ( !options.margin) {
|
|
287
|
+
x -= parseInt(jQuery.css(elem, 'marginLeft')) || 0;
|
|
288
|
+
y -= parseInt(jQuery.css(elem, 'marginTop')) || 0;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
// Safari and Opera do not add the border for the element
|
|
292
|
+
if ( options.border && (jQuery.browser.safari || jQuery.browser.opera) ) {
|
|
293
|
+
x += parseInt(jQuery.css(elem, 'borderLeftWidth')) || 0;
|
|
294
|
+
y += parseInt(jQuery.css(elem, 'borderTopWidth')) || 0;
|
|
295
|
+
} else if ( !options.border && !(jQuery.browser.safari || jQuery.browser.opera) ) {
|
|
296
|
+
x -= parseInt(jQuery.css(elem, 'borderLeftWidth')) || 0;
|
|
297
|
+
y -= parseInt(jQuery.css(elem, 'borderTopWidth')) || 0;
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
if ( options.padding ) {
|
|
301
|
+
x += parseInt(jQuery.css(elem, 'paddingLeft')) || 0;
|
|
302
|
+
y += parseInt(jQuery.css(elem, 'paddingTop')) || 0;
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
// Opera thinks offset is scroll offset for display: inline elements
|
|
306
|
+
if (options.scroll && jQuery.browser.opera && jQuery.css(elem, 'display') == 'inline') {
|
|
307
|
+
sl -= elem.scrollLeft || 0;
|
|
308
|
+
st -= elem.scrollTop || 0;
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
var returnValue = options.scroll ? { top: y - st, left: x - sl, scrollTop: st, scrollLeft: sl }
|
|
312
|
+
: { top: y, left: x };
|
|
313
|
+
|
|
314
|
+
if (returnObject) { jQuery.extend(returnObject, returnValue); return this; }
|
|
315
|
+
else { return returnValue; }
|
|
316
|
+
};
|
|
317
|
+
|
|
318
|
+
|
|
319
|
+
|
|
320
|
+
// FORM PLUGIN
|
|
321
|
+
|
|
322
|
+
/*
|
|
323
|
+
* jQuery form plugin
|
|
324
|
+
* @requires jQuery v1.0.3
|
|
325
|
+
*
|
|
326
|
+
* Dual licensed under the MIT and GPL licenses:
|
|
327
|
+
* http://www.opensource.org/licenses/mit-license.php
|
|
328
|
+
* http://www.gnu.org/licenses/gpl.html
|
|
329
|
+
*
|
|
330
|
+
* Revision: $Id$
|
|
331
|
+
* Version: 0.9
|
|
332
|
+
*/
|
|
333
|
+
|
|
334
|
+
/**
|
|
335
|
+
* ajaxSubmit() provides a mechanism for submitting an HTML form using AJAX.
|
|
336
|
+
*
|
|
337
|
+
* ajaxSubmit accepts a single argument which can be either a success callback function
|
|
338
|
+
* or an options Object. If a function is provided it will be invoked upon successful
|
|
339
|
+
* completion of the submit and will be passed the response from the server.
|
|
340
|
+
* If an options Object is provided, the following attributes are supported:
|
|
341
|
+
*
|
|
342
|
+
* target: Identifies the element(s) in the page to be updated with the server response.
|
|
343
|
+
* This value may be specified as a jQuery selection string, a jQuery object,
|
|
344
|
+
* or a DOM element.
|
|
345
|
+
* default value: null
|
|
346
|
+
*
|
|
347
|
+
* url: URL to which the form data will be submitted.
|
|
348
|
+
* default value: value of form's 'action' attribute
|
|
349
|
+
*
|
|
350
|
+
* method: @deprecated use 'type'
|
|
351
|
+
* type: The method in which the form data should be submitted, 'GET' or 'POST'.
|
|
352
|
+
* default value: value of form's 'method' attribute (or 'GET' if none found)
|
|
353
|
+
*
|
|
354
|
+
* before: @deprecated use 'beforeSubmit'
|
|
355
|
+
* beforeSubmit: Callback method to be invoked before the form is submitted.
|
|
356
|
+
* default value: null
|
|
357
|
+
*
|
|
358
|
+
* after: @deprecated use 'success'
|
|
359
|
+
* success: Callback method to be invoked after the form has been successfully submitted
|
|
360
|
+
* and the response has been returned from the server
|
|
361
|
+
* default value: null
|
|
362
|
+
*
|
|
363
|
+
* dataType: Expected dataType of the response. One of: null, 'xml', 'script', or 'json'
|
|
364
|
+
* default value: null
|
|
365
|
+
*
|
|
366
|
+
* semantic: Boolean flag indicating whether data must be submitted in semantic order (slower).
|
|
367
|
+
* default value: false
|
|
368
|
+
*
|
|
369
|
+
* resetForm: Boolean flag indicating whether the form should be reset if the submit is successful
|
|
370
|
+
*
|
|
371
|
+
* clearForm: Boolean flag indicating whether the form should be cleared if the submit is successful
|
|
372
|
+
*
|
|
373
|
+
*
|
|
374
|
+
* The 'beforeSubmit' callback can be provided as a hook for running pre-submit logic or for
|
|
375
|
+
* validating the form data. If the 'beforeSubmit' callback returns false then the form will
|
|
376
|
+
* not be submitted. The 'beforeSubmit' callback is invoked with three arguments: the form data
|
|
377
|
+
* in array format, the jQuery object, and the options object passed into ajaxSubmit.
|
|
378
|
+
* The form data array takes the following form:
|
|
379
|
+
*
|
|
380
|
+
* [ { name: 'username', value: 'jresig' }, { name: 'password', value: 'secret' } ]
|
|
381
|
+
*
|
|
382
|
+
* If a 'success' callback method is provided it is invoked after the response has been returned
|
|
383
|
+
* from the server. It is passed the responseText or responseXML value (depending on dataType).
|
|
384
|
+
* See jQuery.ajax for further details.
|
|
385
|
+
*
|
|
386
|
+
*
|
|
387
|
+
* The dataType option provides a means for specifying how the server response should be handled.
|
|
388
|
+
* This maps directly to the jQuery.httpData method. The following values are supported:
|
|
389
|
+
*
|
|
390
|
+
* 'xml': if dataType == 'xml' the server response is treated as XML and the 'after'
|
|
391
|
+
* callback method, if specified, will be passed the responseXML value
|
|
392
|
+
* 'json': if dataType == 'json' the server response will be evaluted and passed to
|
|
393
|
+
* the 'after' callback, if specified
|
|
394
|
+
* 'script': if dataType == 'script' the server response is evaluated in the global context
|
|
395
|
+
*
|
|
396
|
+
*
|
|
397
|
+
* Note that it does not make sense to use both the 'target' and 'dataType' options. If both
|
|
398
|
+
* are provided the target will be ignored.
|
|
399
|
+
*
|
|
400
|
+
* The semantic argument can be used to force form serialization in semantic order.
|
|
401
|
+
* This is normally true anyway, unless the form contains input elements of type='image'.
|
|
402
|
+
* If your form must be submitted with name/value pairs in semantic order and your form
|
|
403
|
+
* contains an input of type='image" then pass true for this arg, otherwise pass false
|
|
404
|
+
* (or nothing) to avoid the overhead for this logic.
|
|
405
|
+
*
|
|
406
|
+
*
|
|
407
|
+
* When used on its own, ajaxSubmit() is typically bound to a form's submit event like this:
|
|
408
|
+
*
|
|
409
|
+
* $("#form-id").submit(function() {
|
|
410
|
+
* $(this).ajaxSubmit(options);
|
|
411
|
+
* return false; // cancel conventional submit
|
|
412
|
+
* });
|
|
413
|
+
*
|
|
414
|
+
* When using ajaxForm(), however, this is done for you.
|
|
415
|
+
*
|
|
416
|
+
* @example
|
|
417
|
+
* $('#myForm').ajaxSubmit(function(data) {
|
|
418
|
+
* alert('Form submit succeeded! Server returned: ' + data);
|
|
419
|
+
* });
|
|
420
|
+
* @desc Submit form and alert server response
|
|
421
|
+
*
|
|
422
|
+
*
|
|
423
|
+
* @example
|
|
424
|
+
* var options = {
|
|
425
|
+
* target: '#myTargetDiv'
|
|
426
|
+
* };
|
|
427
|
+
* $('#myForm').ajaxSubmit(options);
|
|
428
|
+
* @desc Submit form and update page element with server response
|
|
429
|
+
*
|
|
430
|
+
*
|
|
431
|
+
* @example
|
|
432
|
+
* var options = {
|
|
433
|
+
* success: function(responseText) {
|
|
434
|
+
* alert(responseText);
|
|
435
|
+
* }
|
|
436
|
+
* };
|
|
437
|
+
* $('#myForm').ajaxSubmit(options);
|
|
438
|
+
* @desc Submit form and alert the server response
|
|
439
|
+
*
|
|
440
|
+
*
|
|
441
|
+
* @example
|
|
442
|
+
* var options = {
|
|
443
|
+
* beforeSubmit: function(formArray, jqForm) {
|
|
444
|
+
* if (formArray.length == 0) {
|
|
445
|
+
* alert('Please enter data.');
|
|
446
|
+
* return false;
|
|
447
|
+
* }
|
|
448
|
+
* }
|
|
449
|
+
* };
|
|
450
|
+
* $('#myForm').ajaxSubmit(options);
|
|
451
|
+
* @desc Pre-submit validation which aborts the submit operation if form data is empty
|
|
452
|
+
*
|
|
453
|
+
*
|
|
454
|
+
* @example
|
|
455
|
+
* var options = {
|
|
456
|
+
* url: myJsonUrl.php,
|
|
457
|
+
* dataType: 'json',
|
|
458
|
+
* success: function(data) {
|
|
459
|
+
* // 'data' is an object representing the the evaluated json data
|
|
460
|
+
* }
|
|
461
|
+
* };
|
|
462
|
+
* $('#myForm').ajaxSubmit(options);
|
|
463
|
+
* @desc json data returned and evaluated
|
|
464
|
+
*
|
|
465
|
+
*
|
|
466
|
+
* @example
|
|
467
|
+
* var options = {
|
|
468
|
+
* url: myXmlUrl.php,
|
|
469
|
+
* dataType: 'xml',
|
|
470
|
+
* success: function(responseXML) {
|
|
471
|
+
* // responseXML is XML document object
|
|
472
|
+
* var data = $('myElement', responseXML).text();
|
|
473
|
+
* }
|
|
474
|
+
* };
|
|
475
|
+
* $('#myForm').ajaxSubmit(options);
|
|
476
|
+
* @desc XML data returned from server
|
|
477
|
+
*
|
|
478
|
+
*
|
|
479
|
+
* @example
|
|
480
|
+
* var options = {
|
|
481
|
+
* resetForm: true
|
|
482
|
+
* };
|
|
483
|
+
* $('#myForm').ajaxSubmit(options);
|
|
484
|
+
* @desc submit form and reset it if successful
|
|
485
|
+
*
|
|
486
|
+
* @example
|
|
487
|
+
* $('#myForm).submit(function() {
|
|
488
|
+
* $(this).ajaxSubmit();
|
|
489
|
+
* return false;
|
|
490
|
+
* });
|
|
491
|
+
* @desc Bind form's submit event to use ajaxSubmit
|
|
492
|
+
*
|
|
493
|
+
*
|
|
494
|
+
* @name ajaxSubmit
|
|
495
|
+
* @type jQuery
|
|
496
|
+
* @param options object literal containing options which control the form submission process
|
|
497
|
+
* @cat Plugins/Form
|
|
498
|
+
* @return jQuery
|
|
499
|
+
* @see formToArray
|
|
500
|
+
* @see ajaxForm
|
|
501
|
+
* @see $.ajax
|
|
502
|
+
* @author jQuery Community
|
|
503
|
+
*/
|
|
504
|
+
jQuery.fn.ajaxSubmit = function(options) {
|
|
505
|
+
if (typeof options == 'function')
|
|
506
|
+
options = { success: options };
|
|
507
|
+
|
|
508
|
+
options = jQuery.extend({
|
|
509
|
+
url: this.attr('action') || '',
|
|
510
|
+
method: this.attr('method') || 'GET'
|
|
511
|
+
}, options || {});
|
|
512
|
+
|
|
513
|
+
// remap deprecated options (temporarily)
|
|
514
|
+
options.success = options.success || options.after;
|
|
515
|
+
options.beforeSubmit = options.beforeSubmit || options.before;
|
|
516
|
+
options.type = options.type || options.method;
|
|
517
|
+
|
|
518
|
+
var a = this.formToArray(options.semantic);
|
|
519
|
+
|
|
520
|
+
// give pre-submit callback an opportunity to abort the submit
|
|
521
|
+
if (options.beforeSubmit && options.beforeSubmit(a, this, options) === false) return this;
|
|
522
|
+
|
|
523
|
+
var q = jQuery.param(a);
|
|
524
|
+
|
|
525
|
+
if (options.type.toUpperCase() == 'GET') {
|
|
526
|
+
// if url already has a '?' then append args after '&'
|
|
527
|
+
options.url += (options.url.indexOf('?') >= 0 ? '&' : '?') + q;
|
|
528
|
+
options.data = null; // data is null for 'get'
|
|
529
|
+
}
|
|
530
|
+
else
|
|
531
|
+
options.data = q; // data is the query string for 'post'
|
|
532
|
+
|
|
533
|
+
var $form = this, callbacks = [];
|
|
534
|
+
if (options.resetForm) callbacks.push(function() { $form.resetForm(); });
|
|
535
|
+
if (options.clearForm) callbacks.push(function() { $form.clearForm(); });
|
|
536
|
+
|
|
537
|
+
// perform a load on the target only if dataType is not provided
|
|
538
|
+
if (!options.dataType && options.target) {
|
|
539
|
+
var oldSuccess = options.success || function(){};
|
|
540
|
+
callbacks.push(function(data, status) {
|
|
541
|
+
jQuery(options.target).attr("innerHTML", data).evalScripts().each(oldSuccess, [data, status]);
|
|
542
|
+
});
|
|
543
|
+
}
|
|
544
|
+
else if (options.success)
|
|
545
|
+
callbacks.push(options.success);
|
|
546
|
+
|
|
547
|
+
options.success = function(data, status) {
|
|
548
|
+
for (var i=0, max=callbacks.length; i < max; i++)
|
|
549
|
+
callbacks[i](data, status);
|
|
550
|
+
};
|
|
551
|
+
|
|
552
|
+
jQuery.ajax(options);
|
|
553
|
+
return this;
|
|
554
|
+
};
|
|
555
|
+
|
|
556
|
+
/**
|
|
557
|
+
* ajaxForm() provides a mechanism for fully automating form submission.
|
|
558
|
+
*
|
|
559
|
+
* The advantages of using this method instead of ajaxSubmit() are:
|
|
560
|
+
*
|
|
561
|
+
* 1: This method will include coordinates for <input type="image" /> elements (if the element
|
|
562
|
+
* is used to submit the form).
|
|
563
|
+
* 2. This method will include the submit element's name/value data (for the element that was
|
|
564
|
+
* used to submit the form).
|
|
565
|
+
* 3. This method binds the submit() method to the form for you.
|
|
566
|
+
*
|
|
567
|
+
* Note that for accurate x/y coordinates of image submit elements in all browsers
|
|
568
|
+
* you need to also use the "dimensions" plugin (this method will auto-detect its presence).
|
|
569
|
+
*
|
|
570
|
+
* The options argument for ajaxForm works exactly as it does for ajaxSubmit. ajaxForm merely
|
|
571
|
+
* passes the options argument along after properly binding events for submit elements and
|
|
572
|
+
* the form itself. See ajaxSubmit for a full description of the options argument.
|
|
573
|
+
*
|
|
574
|
+
*
|
|
575
|
+
* @example
|
|
576
|
+
* var options = {
|
|
577
|
+
* target: '#myTargetDiv'
|
|
578
|
+
* };
|
|
579
|
+
* $('#myForm').ajaxSForm(options);
|
|
580
|
+
* @desc Bind form's submit event so that 'myTargetDiv' is updated with the server response
|
|
581
|
+
* when the form is submitted.
|
|
582
|
+
*
|
|
583
|
+
*
|
|
584
|
+
* @example
|
|
585
|
+
* var options = {
|
|
586
|
+
* success: function(responseText) {
|
|
587
|
+
* alert(responseText);
|
|
588
|
+
* }
|
|
589
|
+
* };
|
|
590
|
+
* $('#myForm').ajaxSubmit(options);
|
|
591
|
+
* @desc Bind form's submit event so that server response is alerted after the form is submitted.
|
|
592
|
+
*
|
|
593
|
+
*
|
|
594
|
+
* @example
|
|
595
|
+
* var options = {
|
|
596
|
+
* beforeSubmit: function(formArray, jqForm) {
|
|
597
|
+
* if (formArray.length == 0) {
|
|
598
|
+
* alert('Please enter data.');
|
|
599
|
+
* return false;
|
|
600
|
+
* }
|
|
601
|
+
* }
|
|
602
|
+
* };
|
|
603
|
+
* $('#myForm').ajaxSubmit(options);
|
|
604
|
+
* @desc Bind form's submit event so that pre-submit callback is invoked before the form
|
|
605
|
+
* is submitted.
|
|
606
|
+
*
|
|
607
|
+
*
|
|
608
|
+
* @name ajaxForm
|
|
609
|
+
* @param options object literal containing options which control the form submission process
|
|
610
|
+
* @return jQuery
|
|
611
|
+
* @cat Plugins/Form
|
|
612
|
+
* @type jQuery
|
|
613
|
+
* @see ajaxSubmit
|
|
614
|
+
* @author jQuery Community
|
|
615
|
+
*/
|
|
616
|
+
jQuery.fn.ajaxForm = function(options) {
|
|
617
|
+
return this.each(function() {
|
|
618
|
+
jQuery("input:submit,input:image,button:submit", this).click(function(ev) {
|
|
619
|
+
var $form = this.form;
|
|
620
|
+
$form.clk = this;
|
|
621
|
+
if (this.type == 'image') {
|
|
622
|
+
if (ev.offsetX != undefined) {
|
|
623
|
+
$form.clk_x = ev.offsetX;
|
|
624
|
+
$form.clk_y = ev.offsetY;
|
|
625
|
+
} else if (typeof jQuery.fn.offset == 'function') { // try to use dimensions plugin
|
|
626
|
+
var offset = jQuery(this).offset();
|
|
627
|
+
$form.clk_x = ev.pageX - offset.left;
|
|
628
|
+
$form.clk_y = ev.pageY - offset.top;
|
|
629
|
+
} else {
|
|
630
|
+
$form.clk_x = ev.pageX - this.offsetLeft;
|
|
631
|
+
$form.clk_y = ev.pageY - this.offsetTop;
|
|
632
|
+
}
|
|
633
|
+
}
|
|
634
|
+
// clear form vars
|
|
635
|
+
setTimeout(function() {
|
|
636
|
+
$form.clk = $form.clk_x = $form.clk_y = null;
|
|
637
|
+
}, 10);
|
|
638
|
+
})
|
|
639
|
+
}).submit(function(e) {
|
|
640
|
+
jQuery(this).ajaxSubmit(options);
|
|
641
|
+
return false;
|
|
642
|
+
});
|
|
643
|
+
};
|
|
644
|
+
|
|
645
|
+
|
|
646
|
+
/**
|
|
647
|
+
* formToArray() gathers form element data into an array of objects that can
|
|
648
|
+
* be passed to any of the following ajax functions: $.get, $.post, or load.
|
|
649
|
+
* Each object in the array has both a 'name' and 'value' property. An example of
|
|
650
|
+
* an array for a simple login form might be:
|
|
651
|
+
*
|
|
652
|
+
* [ { name: 'username', value: 'jresig' }, { name: 'password', value: 'secret' } ]
|
|
653
|
+
*
|
|
654
|
+
* It is this array that is passed to pre-submit callback functions provided to the
|
|
655
|
+
* ajaxSubmit() and ajaxForm() methods.
|
|
656
|
+
*
|
|
657
|
+
* The semantic argument can be used to force form serialization in semantic order.
|
|
658
|
+
* This is normally true anyway, unless the form contains input elements of type='image'.
|
|
659
|
+
* If your form must be submitted with name/value pairs in semantic order and your form
|
|
660
|
+
* contains an input of type='image" then pass true for this arg, otherwise pass false
|
|
661
|
+
* (or nothing) to avoid the overhead for this logic.
|
|
662
|
+
*
|
|
663
|
+
* @example var data = $("#myForm").formToArray();
|
|
664
|
+
* $.post( "myscript.cgi", data );
|
|
665
|
+
* @desc Collect all the data from a form and submit it to the server.
|
|
666
|
+
*
|
|
667
|
+
* @name formToArray
|
|
668
|
+
* @param semantic true if serialization must maintain strict semantic ordering of elements (slower)
|
|
669
|
+
* @type Array<Object>
|
|
670
|
+
* @cat Plugins/Form
|
|
671
|
+
* @see ajaxForm
|
|
672
|
+
* @see ajaxSubmit
|
|
673
|
+
* @author jQuery Community
|
|
674
|
+
*/
|
|
675
|
+
jQuery.fn.formToArray = function(semantic) {
|
|
676
|
+
var a = [];
|
|
677
|
+
if (this.length == 0) return a;
|
|
678
|
+
|
|
679
|
+
var form = this[0];
|
|
680
|
+
var els = semantic ? form.getElementsByTagName('*') : form.elements;
|
|
681
|
+
if (!els) return a;
|
|
682
|
+
for(var i=0, max=els.length; i < max; i++) {
|
|
683
|
+
var el = els[i];
|
|
684
|
+
var n = el.name;
|
|
685
|
+
if (!n) continue;
|
|
686
|
+
|
|
687
|
+
if (semantic && form.clk && el.type == "image") {
|
|
688
|
+
// handle image inputs on the fly when semantic == true
|
|
689
|
+
if(!el.disabled && form.clk == el)
|
|
690
|
+
a.push({name: n+'.x', value: form.clk_x}, {name: n+'.y', value: form.clk_y});
|
|
691
|
+
continue;
|
|
692
|
+
}
|
|
693
|
+
var v = jQuery.fieldValue(el, true);
|
|
694
|
+
if (v === null) continue;
|
|
695
|
+
if (v.constructor == Array) {
|
|
696
|
+
for(var j=0, jmax=v.length; j < jmax; j++)
|
|
697
|
+
a.push({name: n, value: v[j]});
|
|
698
|
+
}
|
|
699
|
+
else
|
|
700
|
+
a.push({name: n, value: v});
|
|
701
|
+
}
|
|
702
|
+
|
|
703
|
+
if (!semantic && form.clk) {
|
|
704
|
+
// input type=='image' are not found in elements array! handle them here
|
|
705
|
+
var inputs = form.getElementsByTagName("input");
|
|
706
|
+
for(var i=0, max=inputs.length; i < max; i++) {
|
|
707
|
+
var input = inputs[i];
|
|
708
|
+
var n = input.name;
|
|
709
|
+
if(n && !input.disabled && input.type == "image" && form.clk == input)
|
|
710
|
+
a.push({name: n+'.x', value: form.clk_x}, {name: n+'.y', value: form.clk_y});
|
|
711
|
+
}
|
|
712
|
+
}
|
|
713
|
+
return a;
|
|
714
|
+
};
|
|
715
|
+
|
|
716
|
+
|
|
717
|
+
/**
|
|
718
|
+
* Serializes form data into a 'submittable' string. This method will return a string
|
|
719
|
+
* in the format: name1=value1&name2=value2
|
|
720
|
+
*
|
|
721
|
+
* The semantic argument can be used to force form serialization in semantic order.
|
|
722
|
+
* If your form must be submitted with name/value pairs in semantic order then pass
|
|
723
|
+
* true for this arg, otherwise pass false (or nothing) to avoid the overhead for
|
|
724
|
+
* this logic (which can be significant for very large forms).
|
|
725
|
+
*
|
|
726
|
+
* @example var data = $("#myForm").formSerialize();
|
|
727
|
+
* $.ajax('POST', "myscript.cgi", data);
|
|
728
|
+
* @desc Collect all the data from a form into a single string
|
|
729
|
+
*
|
|
730
|
+
* @name formSerialize
|
|
731
|
+
* @param semantic true if serialization must maintain strict semantic ordering of elements (slower)
|
|
732
|
+
* @type String
|
|
733
|
+
* @cat Plugins/Form
|
|
734
|
+
* @see formToArray
|
|
735
|
+
* @author jQuery Community
|
|
736
|
+
*/
|
|
737
|
+
jQuery.fn.formSerialize = function(semantic) {
|
|
738
|
+
//hand off to jQuery.param for proper encoding
|
|
739
|
+
return jQuery.param(this.formToArray(semantic));
|
|
740
|
+
};
|
|
741
|
+
|
|
742
|
+
|
|
743
|
+
/**
|
|
744
|
+
* Serializes all field elements in the jQuery object into a query string.
|
|
745
|
+
* This method will return a string in the format: name1=value1&name2=value2
|
|
746
|
+
*
|
|
747
|
+
* The successful argument controls whether or not serialization is limited to
|
|
748
|
+
* 'successful' controls (per http://www.w3.org/TR/html4/interact/forms.html#successful-controls).
|
|
749
|
+
* The default value of the successful argument is true.
|
|
750
|
+
*
|
|
751
|
+
* @example var data = $("input").formSerialize();
|
|
752
|
+
* @desc Collect the data from all successful input elements into a query string
|
|
753
|
+
*
|
|
754
|
+
* @example var data = $(":radio").formSerialize();
|
|
755
|
+
* @desc Collect the data from all successful radio input elements into a query string
|
|
756
|
+
*
|
|
757
|
+
* @example var data = $("#myForm :checkbox").formSerialize();
|
|
758
|
+
* @desc Collect the data from all successful checkbox input elements in myForm into a query string
|
|
759
|
+
*
|
|
760
|
+
* @example var data = $("#myForm :checkbox").formSerialize(false);
|
|
761
|
+
* @desc Collect the data from all checkbox elements in myForm (even the unchecked ones) into a query string
|
|
762
|
+
*
|
|
763
|
+
* @example var data = $(":input").formSerialize();
|
|
764
|
+
* @desc Collect the data from all successful input, select, textarea and button elements into a query string
|
|
765
|
+
*
|
|
766
|
+
* @name fieldSerialize
|
|
767
|
+
* @param successful true if only successful controls should be serialized (default is true)
|
|
768
|
+
* @type String
|
|
769
|
+
* @cat Plugins/Form
|
|
770
|
+
*/
|
|
771
|
+
jQuery.fn.fieldSerialize = function(successful) {
|
|
772
|
+
var a = [];
|
|
773
|
+
this.each(function() {
|
|
774
|
+
var n = this.name;
|
|
775
|
+
if (!n) return;
|
|
776
|
+
var v = jQuery.fieldValue(this, successful);
|
|
777
|
+
if (v && v.constructor == Array) {
|
|
778
|
+
for (var i=0,max=v.length; i < max; i++)
|
|
779
|
+
a.push({name: n, value: v[i]});
|
|
780
|
+
}
|
|
781
|
+
else if (v !== null && typeof v != 'undefined')
|
|
782
|
+
a.push({name: this.name, value: v});
|
|
783
|
+
});
|
|
784
|
+
//hand off to jQuery.param for proper encoding
|
|
785
|
+
return jQuery.param(a);
|
|
786
|
+
};
|
|
787
|
+
|
|
788
|
+
|
|
789
|
+
/**
|
|
790
|
+
* Returns the value of the field element in the jQuery object. If there is more than one field element
|
|
791
|
+
* in the jQuery object the value of the first successful one is returned.
|
|
792
|
+
*
|
|
793
|
+
* The successful argument controls whether or not the field element must be 'successful'
|
|
794
|
+
* (per http://www.w3.org/TR/html4/interact/forms.html#successful-controls).
|
|
795
|
+
* The default value of the successful argument is true. If this value is false then
|
|
796
|
+
* the value of the first field element in the jQuery object is returned.
|
|
797
|
+
*
|
|
798
|
+
* Note: If no valid value can be determined the return value will be undifined.
|
|
799
|
+
*
|
|
800
|
+
* Note: The fieldValue returned for a select-multiple element or for a checkbox input will
|
|
801
|
+
* always be an array if it is not undefined.
|
|
802
|
+
*
|
|
803
|
+
*
|
|
804
|
+
* @example var data = $("#myPasswordElement").formValue();
|
|
805
|
+
* @desc Gets the current value of the myPasswordElement element
|
|
806
|
+
*
|
|
807
|
+
* @example var data = $("#myForm :input").formValue();
|
|
808
|
+
* @desc Get the value of the first successful control in the jQuery object.
|
|
809
|
+
*
|
|
810
|
+
* @example var data = $("#myForm :checkbox").formValue();
|
|
811
|
+
* @desc Get the array of values for the first set of successful checkbox controls in the jQuery object.
|
|
812
|
+
*
|
|
813
|
+
* @example var data = $("#mySingleSelect").formValue();
|
|
814
|
+
* @desc Get the value of the select control
|
|
815
|
+
*
|
|
816
|
+
* @example var data = $("#myMultiSelect").formValue();
|
|
817
|
+
* @desc Get the array of selected values for the select-multiple control
|
|
818
|
+
*
|
|
819
|
+
* @name fieldValue
|
|
820
|
+
* @param Boolean successful true if value returned must be for a successful controls (default is true)
|
|
821
|
+
* @type String or Array<String>
|
|
822
|
+
* @cat Plugins/Form
|
|
823
|
+
*/
|
|
824
|
+
jQuery.fn.fieldValue = function(successful) {
|
|
825
|
+
var cbVal, cbName;
|
|
826
|
+
|
|
827
|
+
// loop until we find a value
|
|
828
|
+
for (var i=0, max=this.length; i < max; i++) {
|
|
829
|
+
var el = this[i];
|
|
830
|
+
var v = jQuery.fieldValue(el, successful);
|
|
831
|
+
if (v === null || typeof v == 'undefined' || (v.constructor == Array && !v.length))
|
|
832
|
+
continue;
|
|
833
|
+
|
|
834
|
+
// for checkboxes, consider multiple elements, for everything else just return first valid value
|
|
835
|
+
if (el.type != 'checkbox') return v;
|
|
836
|
+
|
|
837
|
+
cbName = cbName || el.name;
|
|
838
|
+
if (cbName != el.name) // return if we hit a checkbox with a different name
|
|
839
|
+
return cbVal;
|
|
840
|
+
cbVal = cbVal || [];
|
|
841
|
+
cbVal.push(v);
|
|
842
|
+
}
|
|
843
|
+
return cbVal;
|
|
844
|
+
};
|
|
845
|
+
|
|
846
|
+
/**
|
|
847
|
+
* Returns the value of the field element.
|
|
848
|
+
*
|
|
849
|
+
* The successful argument controls whether or not the field element must be 'successful'
|
|
850
|
+
* (per http://www.w3.org/TR/html4/interact/forms.html#successful-controls).
|
|
851
|
+
* The default value of the successful argument is true. If the given element is not
|
|
852
|
+
* successful and the successful arg is not false then the returned value will be null.
|
|
853
|
+
*
|
|
854
|
+
* Note: The fieldValue returned for a select-multiple element will always be an array.
|
|
855
|
+
*
|
|
856
|
+
* @example var data = jQuery.fieldValue($("#myPasswordElement")[0]);
|
|
857
|
+
* @desc Gets the current value of the myPasswordElement element
|
|
858
|
+
*
|
|
859
|
+
* @name fieldValue
|
|
860
|
+
* @param Element el The DOM element for which the value will be returned
|
|
861
|
+
* @param Boolean successful true if value returned must be for a successful controls (default is true)
|
|
862
|
+
* @type String or Array<String>
|
|
863
|
+
* @cat Plugins/Form
|
|
864
|
+
*/
|
|
865
|
+
jQuery.fieldValue = function(el, successful) {
|
|
866
|
+
var n = el.name, t = el.type, tag = el.tagName.toLowerCase();
|
|
867
|
+
if (typeof successful == 'undefined') successful = true;
|
|
868
|
+
|
|
869
|
+
if (successful && ( !n || el.disabled || t == 'reset' ||
|
|
870
|
+
(t == 'checkbox' || t == 'radio') && !el.checked ||
|
|
871
|
+
(t == 'submit' || t == 'image') && el.form && el.form.clk != el ||
|
|
872
|
+
tag == 'select' && el.selectedIndex == -1))
|
|
873
|
+
return null;
|
|
874
|
+
|
|
875
|
+
if (tag == 'select') {
|
|
876
|
+
var index = el.selectedIndex;
|
|
877
|
+
if (index < 0) return null;
|
|
878
|
+
var a = [], ops = el.options;
|
|
879
|
+
var one = (t == 'select-one');
|
|
880
|
+
var max = (one ? index+1 : ops.length);
|
|
881
|
+
for(var i=(one ? index : 0); i < max; i++) {
|
|
882
|
+
var op = ops[i];
|
|
883
|
+
if (op.selected) {
|
|
884
|
+
// extra pain for IE...
|
|
885
|
+
var v = jQuery.browser.msie && !(op.attributes['value'].specified) ? op.text : op.value;
|
|
886
|
+
if (one) return v;
|
|
887
|
+
a.push(v);
|
|
888
|
+
}
|
|
889
|
+
}
|
|
890
|
+
return a;
|
|
891
|
+
}
|
|
892
|
+
return el.value;
|
|
893
|
+
};
|
|
894
|
+
|
|
895
|
+
|
|
896
|
+
/**
|
|
897
|
+
* Clears the form data. Takes the following actions on the form's input fields:
|
|
898
|
+
* - input text fields will have their 'value' property set to the empty string
|
|
899
|
+
* - select elements will have their 'selectedIndex' property set to -1
|
|
900
|
+
* - checkbox and radio inputs will have their 'checked' property set to false
|
|
901
|
+
* - inputs of type submit, button, reset, and hidden will *not* be effected
|
|
902
|
+
* - button elements will *not* be effected
|
|
903
|
+
*
|
|
904
|
+
* @example $('form').clearForm();
|
|
905
|
+
* @desc Clears all forms on the page.
|
|
906
|
+
*
|
|
907
|
+
* @name clearForm
|
|
908
|
+
* @type jQuery
|
|
909
|
+
* @cat Plugins/Form
|
|
910
|
+
* @see resetForm
|
|
911
|
+
*/
|
|
912
|
+
jQuery.fn.clearForm = function() {
|
|
913
|
+
return this.each(function() {
|
|
914
|
+
jQuery('input,select,textarea', this).clearFields();
|
|
915
|
+
});
|
|
916
|
+
};
|
|
917
|
+
|
|
918
|
+
/**
|
|
919
|
+
* Clears the selected form elements. Takes the following actions on the matched elements:
|
|
920
|
+
* - input text fields will have their 'value' property set to the empty string
|
|
921
|
+
* - select elements will have their 'selectedIndex' property set to -1
|
|
922
|
+
* - checkbox and radio inputs will have their 'checked' property set to false
|
|
923
|
+
* - inputs of type submit, button, reset, and hidden will *not* be effected
|
|
924
|
+
* - button elements will *not* be effected
|
|
925
|
+
*
|
|
926
|
+
* @example $('.myInputs').clearFields();
|
|
927
|
+
* @desc Clears all inputs with class myInputs
|
|
928
|
+
*
|
|
929
|
+
* @name clearFields
|
|
930
|
+
* @type jQuery
|
|
931
|
+
* @cat Plugins/Form
|
|
932
|
+
* @see clearForm
|
|
933
|
+
*/
|
|
934
|
+
jQuery.fn.clearFields = jQuery.fn.clearInputs = function() {
|
|
935
|
+
return this.each(function() {
|
|
936
|
+
var t = this.type, tag = this.tagName.toLowerCase();
|
|
937
|
+
if (t == 'text' || t == 'password' || tag == 'textarea')
|
|
938
|
+
this.value = '';
|
|
939
|
+
else if (t == 'checkbox' || t == 'radio')
|
|
940
|
+
this.checked = false;
|
|
941
|
+
else if (tag == 'select')
|
|
942
|
+
this.selectedIndex = -1;
|
|
943
|
+
});
|
|
944
|
+
};
|
|
945
|
+
|
|
946
|
+
|
|
947
|
+
/**
|
|
948
|
+
* Resets the form data. Causes all form elements to be reset to their original value.
|
|
949
|
+
*
|
|
950
|
+
* @example $('form').resetForm();
|
|
951
|
+
* @desc Resets all forms on the page.
|
|
952
|
+
*
|
|
953
|
+
* @name resetForm
|
|
954
|
+
* @type jQuery
|
|
955
|
+
* @cat Plugins/Form
|
|
956
|
+
* @see clearForm
|
|
957
|
+
*/
|
|
958
|
+
jQuery.fn.resetForm = function() {
|
|
959
|
+
return this.each(function() {
|
|
960
|
+
// guard against an input with the name of 'reset'
|
|
961
|
+
// note that IE reports the reset function as an 'object'
|
|
962
|
+
if (typeof this.reset == 'function' || (typeof this.reset == 'object' && !this.reset.nodeType))
|
|
963
|
+
this.reset();
|
|
964
|
+
});
|
|
965
|
+
};
|