burp_cms 1.3.0
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/LICENSE.txt +165 -0
- data/README.markdown +11 -0
- data/Rakefile +56 -0
- data/app/assets/images/burp/add-group-to-menu-1.png +0 -0
- data/app/assets/images/burp/add-group-to-menu-2.png +0 -0
- data/app/assets/images/burp/add-group-to-menu-3.png +0 -0
- data/app/assets/images/burp/add-group-to-menu-4.png +0 -0
- data/app/assets/images/burp/add-image-1.png +0 -0
- data/app/assets/images/burp/add-image-2.png +0 -0
- data/app/assets/images/burp/add-image-3.png +0 -0
- data/app/assets/images/burp/add-image-4.png +0 -0
- data/app/assets/images/burp/add-image-5.png +0 -0
- data/app/assets/images/burp/add-link-to-group-1.png +0 -0
- data/app/assets/images/burp/add-link-to-group-2.png +0 -0
- data/app/assets/images/burp/add-link-to-group-3.png +0 -0
- data/app/assets/images/burp/add-link-to-menu-1.png +0 -0
- data/app/assets/images/burp/add-link-to-menu-2.png +0 -0
- data/app/assets/images/burp/add-link-to-menu-3.png +0 -0
- data/app/assets/images/burp/add-link-to-menu-4.png +0 -0
- data/app/assets/images/burp/add-page-to-menu-1.png +0 -0
- data/app/assets/images/burp/add-page-to-menu-2.png +0 -0
- data/app/assets/images/burp/add-page-to-menu-3.png +0 -0
- data/app/assets/images/burp/add-page-to-menu-4.png +0 -0
- data/app/assets/images/burp/add-page-to-menu-5.png +0 -0
- data/app/assets/images/burp/adding-a-page-1.png +0 -0
- data/app/assets/images/burp/adding-a-page-2.png +0 -0
- data/app/assets/images/burp/adding-a-page-3.png +0 -0
- data/app/assets/images/burp/adding-a-page-4.png +0 -0
- data/app/assets/images/burp/change-page-title-1.png +0 -0
- data/app/assets/images/burp/change-page-title-2.png +0 -0
- data/app/assets/images/burp/change-page-title-3.png +0 -0
- data/app/assets/images/burp/change-page-title-4.png +0 -0
- data/app/assets/images/burp/change-the-text-1.png +0 -0
- data/app/assets/images/burp/change-the-text-2.png +0 -0
- data/app/assets/images/burp/change-the-text-3.png +0 -0
- data/app/assets/images/burp/enter-page-edit-mode-1.png +0 -0
- data/app/assets/images/burp/enter-page-edit-mode-2.png +0 -0
- data/app/assets/images/burp/enter-page-edit-mode-3.png +0 -0
- data/app/assets/images/burp/enter-page-edit-mode-4.jpg +0 -0
- data/app/assets/images/burp/enter-page-edit-mode-4.png +0 -0
- data/app/assets/images/burp/img/glyphicons-halflings-white.png +0 -0
- data/app/assets/images/burp/img/glyphicons-halflings.png +0 -0
- data/app/assets/images/burp/move-link-to-bottom-of-menu-1.png +0 -0
- data/app/assets/images/burp/move-link-to-bottom-of-menu-2.png +0 -0
- data/app/assets/images/burp/move-link-to-bottom-of-menu-3.png +0 -0
- data/app/assets/images/burp/remove-a-page-1.png +0 -0
- data/app/assets/images/burp/remove-a-page-2.png +0 -0
- data/app/assets/images/burp/remove-a-page-3.png +0 -0
- data/app/assets/images/burp/remove-a-page-4.png +0 -0
- data/app/assets/images/burp/remove-image-1.png +0 -0
- data/app/assets/images/burp/remove-image-2.png +0 -0
- data/app/assets/images/burp/remove-image-3.png +0 -0
- data/app/assets/images/burp/remove-image-4.png +0 -0
- data/app/assets/images/burp/remove-image-5.png +0 -0
- data/app/assets/images/burp/remove-page-from-menu-1.png +0 -0
- data/app/assets/images/burp/remove-page-from-menu-2.png +0 -0
- data/app/assets/images/burp/remove-page-from-menu-3.png +0 -0
- data/app/assets/images/burp/remove-page-from-menu-4.png +0 -0
- data/app/assets/javascripts/burp/application.js +22 -0
- data/app/assets/javascripts/burp/burp.js +2 -0
- data/app/assets/javascripts/burp/cms_helper.js +49 -0
- data/app/assets/javascripts/burp/edit-page.js +22 -0
- data/app/assets/javascripts/burp/lib/bootstrap.min.js +6 -0
- data/app/assets/javascripts/burp/lib/debug.js +222 -0
- data/app/assets/javascripts/burp/lib/fileupload.js +1255 -0
- data/app/assets/javascripts/burp/lib/missing-restful-verbs.js +46 -0
- data/app/assets/javascripts/burp/menu-functions.js +28 -0
- data/app/assets/javascripts/burp/pages-drag-and-drop.js +151 -0
- data/app/assets/packages/burp/editing/css/dropzone.css +15 -0
- data/app/assets/packages/burp/editing/css/edit-content.less +126 -0
- data/app/assets/packages/burp/editing/css/gallery.css +167 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/LICENSE +23 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/README.md +8 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/demo/activeline.html +72 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/demo/changemode.html +50 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/demo/closetag.html +65 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/demo/complete.html +70 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/demo/emacs.html +59 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/demo/folding.html +61 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/demo/formatting.html +80 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/demo/fullscreen.html +152 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/demo/loadmode.html +39 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/demo/marker.html +52 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/demo/matchhighlighter.html +37 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/demo/multiplex.html +59 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/demo/mustache.html +57 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/demo/preview.html +76 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/demo/resize.html +41 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/demo/runmode.html +49 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/demo/search.html +83 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/demo/theme.html +78 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/demo/vim.html +50 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/demo/visibletabs.html +61 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/doc/baboon.png +0 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/doc/baboon_vector.svg +153 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/doc/compress.html +148 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/doc/docs.css +154 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/doc/internals.html +494 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/doc/manual.html +1128 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/doc/oldrelease.html +267 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/doc/reporting.html +57 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/doc/upgrade_v2.2.html +95 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/index.html +417 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/keymap/emacs.js +29 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/keymap/vim.js +766 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/lib/codemirror.css +168 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/lib/codemirror.js +3181 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/lib/util/closetag.js +146 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/lib/util/dialog.css +23 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/lib/util/dialog.js +63 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/lib/util/foldcode.js +196 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/lib/util/formatting.js +297 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/lib/util/javascript-hint.js +134 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/lib/util/loadmode.js +51 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/lib/util/match-highlighter.js +44 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/lib/util/multiplex.js +72 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/lib/util/overlay.js +52 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/lib/util/pig-hint.js +123 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/lib/util/runmode.js +49 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/lib/util/search.js +118 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/lib/util/searchcursor.js +117 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/lib/util/simple-hint.css +16 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/lib/util/simple-hint.js +72 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/clike/clike.js +271 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/clike/index.html +101 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/clike/scala.html +765 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/clojure/clojure.js +207 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/clojure/index.html +66 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/coffeescript/LICENSE +22 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/coffeescript/coffeescript.js +347 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/coffeescript/index.html +727 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/css/css.js +124 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/css/index.html +55 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/diff/diff.js +32 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/diff/index.html +104 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/ecl/ecl.js +203 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/ecl/index.html +42 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/erlang/erlang.js +251 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/erlang/index.html +61 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/gfm/gfm.js +144 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/gfm/index.html +47 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/go/go.js +170 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/go/index.html +72 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/groovy/groovy.js +210 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/groovy/index.html +71 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/haskell/haskell.js +242 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/haskell/index.html +60 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/htmlembedded/htmlembedded.js +68 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/htmlembedded/index.html +49 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/htmlmixed/htmlmixed.js +85 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/htmlmixed/index.html +51 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/javascript/index.html +77 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/javascript/javascript.js +361 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/jinja2/index.html +37 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/jinja2/jinja2.js +42 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/less/index.html +618 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/less/less.js +232 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/lua/index.html +72 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/lua/lua.js +140 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/markdown/index.html +338 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/markdown/markdown.js +245 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/mysql/index.html +41 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/mysql/mysql.js +188 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/ntriples/index.html +32 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/ntriples/ntriples.js +172 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/pascal/LICENSE +7 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/pascal/index.html +48 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/pascal/pascal.js +94 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/perl/LICENSE +19 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/perl/index.html +62 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/perl/perl.js +816 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/php/index.html +48 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/php/php.js +150 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/pig/index.html +42 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/pig/pig.js +172 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/plsql/index.html +62 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/plsql/plsql.js +217 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/properties/index.html +40 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/properties/properties.js +63 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/python/LICENSE.txt +21 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/python/index.html +122 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/python/python.js +338 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/r/LICENSE +24 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/r/index.html +73 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/r/r.js +141 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/rpm/changes/changes.js +19 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/rpm/changes/index.html +53 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/rpm/spec/index.html +99 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/rpm/spec/spec.css +5 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/rpm/spec/spec.js +66 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/rst/index.html +525 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/rst/rst.js +326 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/ruby/LICENSE +24 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/ruby/index.html +171 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/ruby/ruby.js +195 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/rust/index.html +48 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/rust/rust.js +432 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/scheme/index.html +64 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/scheme/scheme.js +230 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/shell/index.html +50 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/shell/shell.js +103 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/smalltalk/index.html +55 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/smalltalk/smalltalk.js +139 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/smarty/index.html +82 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/smarty/smarty.js +148 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/sparql/index.html +40 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/sparql/sparql.js +143 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/stex/index.html +95 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/stex/stex.js +182 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/stex/test.html +263 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/tiddlywiki/index.html +140 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/tiddlywiki/tiddlywiki.css +14 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/tiddlywiki/tiddlywiki.js +384 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/tiki/index.html +82 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/tiki/tiki.css +26 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/tiki/tiki.js +316 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/vbscript/index.html +42 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/vbscript/vbscript.js +26 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/velocity/index.html +103 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/velocity/velocity.js +146 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/verilog/index.html +210 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/verilog/verilog.js +194 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/xml/index.html +44 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/xml/xml.js +325 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/xquery/LICENSE +20 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/xquery/index.html +222 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/xquery/test/index.html +27 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/xquery/test/testBase.js +42 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/xquery/test/testEmptySequenceKeyword.js +16 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/xquery/test/testMultiAttr.js +16 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/xquery/test/testNamespaces.js +91 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/xquery/test/testProcessingInstructions.js +16 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/xquery/test/testQuotes.js +19 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/xquery/xquery.js +448 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/yaml/index.html +67 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/mode/yaml/yaml.js +95 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/package.json +29 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/test/index.html +28 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/test/mode_test.css +22 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/test/mode_test.js +164 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/test/test.js +344 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/theme/ambiance.css +81 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/theme/blackboard.css +25 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/theme/cobalt.css +18 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/theme/eclipse.css +25 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/theme/elegant.css +10 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/theme/erlang-dark.css +21 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/theme/lesser-dark.css +44 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/theme/monokai.css +28 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/theme/neat.css +9 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/theme/night.css +21 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/theme/rubyblue.css +21 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/theme/vibrant-ink.css +27 -0
- data/app/assets/packages/burp/editing/dep/CodeMirror-2.3/theme/xq-dark.css +46 -0
- data/app/assets/packages/burp/editing/dep/FontAwesome/FontAwesome-Vectors.pdf +3180 -7
- data/app/assets/packages/burp/editing/dep/FontAwesome/FontAwesome.ttf +0 -0
- data/app/assets/packages/burp/editing/dep/FontAwesome/README.md +18 -0
- data/app/assets/packages/burp/editing/dep/FontAwesome/css/font-awesome-ie7.css +645 -0
- data/app/assets/packages/burp/editing/dep/FontAwesome/css/font-awesome.less +309 -0
- data/app/assets/packages/burp/editing/dep/FontAwesome/docs/assets/css/font-awesome-ie7.css +213 -0
- data/app/assets/packages/burp/editing/dep/FontAwesome/docs/assets/css/font-awesome.css +303 -0
- data/app/assets/packages/burp/editing/dep/FontAwesome/docs/assets/css/prettify.css +30 -0
- data/app/assets/packages/burp/editing/dep/FontAwesome/docs/assets/css/site.css +4904 -0
- data/app/assets/packages/burp/editing/dep/FontAwesome/docs/assets/font/fontawesome-webfont.eot +0 -0
- data/app/assets/packages/burp/editing/dep/FontAwesome/docs/assets/font/fontawesome-webfont.svg +255 -0
- data/app/assets/packages/burp/editing/dep/FontAwesome/docs/assets/font/fontawesome-webfont.ttf +0 -0
- data/app/assets/packages/burp/editing/dep/FontAwesome/docs/assets/font/fontawesome-webfont.woff +0 -0
- data/app/assets/packages/burp/editing/dep/FontAwesome/docs/assets/font/museo_slab_300-webfont.eot +0 -0
- data/app/assets/packages/burp/editing/dep/FontAwesome/docs/assets/font/museo_slab_300-webfont.ttf +0 -0
- data/app/assets/packages/burp/editing/dep/FontAwesome/docs/assets/font/museo_slab_500-webfont.eot +0 -0
- data/app/assets/packages/burp/editing/dep/FontAwesome/docs/assets/font/museo_slab_500-webfont.ttf +0 -0
- data/app/assets/packages/burp/editing/dep/FontAwesome/docs/assets/font/proximanova-webfont.eot +0 -0
- data/app/assets/packages/burp/editing/dep/FontAwesome/docs/assets/font/proximanova-webfont.ttf +0 -0
- data/app/assets/packages/burp/editing/dep/FontAwesome/docs/assets/ico/favicon.ico +0 -0
- data/app/assets/packages/burp/editing/dep/FontAwesome/docs/assets/js/backbone.min.js +37 -0
- data/app/assets/packages/burp/editing/dep/FontAwesome/docs/assets/js/index/index.js +89 -0
- data/app/assets/packages/burp/editing/dep/FontAwesome/docs/assets/js/jquery-1.7.1.min.js +4 -0
- data/app/assets/packages/burp/editing/dep/FontAwesome/docs/assets/js/prettify.min.js +28 -0
- data/app/assets/packages/burp/editing/dep/FontAwesome/docs/assets/js/tw-bs-201/bootstrap-alert.js +94 -0
- data/app/assets/packages/burp/editing/dep/FontAwesome/docs/assets/js/tw-bs-201/bootstrap-button.js +98 -0
- data/app/assets/packages/burp/editing/dep/FontAwesome/docs/assets/js/tw-bs-201/bootstrap-carousel.js +157 -0
- data/app/assets/packages/burp/editing/dep/FontAwesome/docs/assets/js/tw-bs-201/bootstrap-collapse.js +136 -0
- data/app/assets/packages/burp/editing/dep/FontAwesome/docs/assets/js/tw-bs-201/bootstrap-dropdown.js +92 -0
- data/app/assets/packages/burp/editing/dep/FontAwesome/docs/assets/js/tw-bs-201/bootstrap-modal.js +210 -0
- data/app/assets/packages/burp/editing/dep/FontAwesome/docs/assets/js/tw-bs-201/bootstrap-popover.js +95 -0
- data/app/assets/packages/burp/editing/dep/FontAwesome/docs/assets/js/tw-bs-201/bootstrap-scrollspy.js +125 -0
- data/app/assets/packages/burp/editing/dep/FontAwesome/docs/assets/js/tw-bs-201/bootstrap-tab.js +130 -0
- data/app/assets/packages/burp/editing/dep/FontAwesome/docs/assets/js/tw-bs-201/bootstrap-tooltip.js +270 -0
- data/app/assets/packages/burp/editing/dep/FontAwesome/docs/assets/js/tw-bs-201/bootstrap-transition.js +51 -0
- data/app/assets/packages/burp/editing/dep/FontAwesome/docs/assets/js/tw-bs-201/bootstrap-typeahead.js +271 -0
- data/app/assets/packages/burp/editing/dep/FontAwesome/docs/assets/js/underscore.min.js +31 -0
- data/app/assets/packages/burp/editing/dep/FontAwesome/docs/assets/less/font-awesome-ie7.less +245 -0
- data/app/assets/packages/burp/editing/dep/FontAwesome/docs/assets/less/font-awesome.less +327 -0
- data/app/assets/packages/burp/editing/dep/FontAwesome/docs/assets/less/font-site.less +26 -0
- data/app/assets/packages/burp/editing/dep/FontAwesome/docs/assets/less/mixins.less +43 -0
- data/app/assets/packages/burp/editing/dep/FontAwesome/docs/assets/less/site.less +300 -0
- data/app/assets/packages/burp/editing/dep/FontAwesome/docs/assets/less/twbs-203/accordion.less +33 -0
- data/app/assets/packages/burp/editing/dep/FontAwesome/docs/assets/less/twbs-203/alerts.less +58 -0
- data/app/assets/packages/burp/editing/dep/FontAwesome/docs/assets/less/twbs-203/bootstrap.less +62 -0
- data/app/assets/packages/burp/editing/dep/FontAwesome/docs/assets/less/twbs-203/breadcrumbs.less +24 -0
- data/app/assets/packages/burp/editing/dep/FontAwesome/docs/assets/less/twbs-203/button-groups.less +191 -0
- data/app/assets/packages/burp/editing/dep/FontAwesome/docs/assets/less/twbs-203/buttons.less +191 -0
- data/app/assets/packages/burp/editing/dep/FontAwesome/docs/assets/less/twbs-203/carousel.less +121 -0
- data/app/assets/packages/burp/editing/dep/FontAwesome/docs/assets/less/twbs-203/close.less +29 -0
- data/app/assets/packages/burp/editing/dep/FontAwesome/docs/assets/less/twbs-203/code.less +57 -0
- data/app/assets/packages/burp/editing/dep/FontAwesome/docs/assets/less/twbs-203/component-animations.less +20 -0
- data/app/assets/packages/burp/editing/dep/FontAwesome/docs/assets/less/twbs-203/dropdowns.less +143 -0
- data/app/assets/packages/burp/editing/dep/FontAwesome/docs/assets/less/twbs-203/forms.less +584 -0
- data/app/assets/packages/burp/editing/dep/FontAwesome/docs/assets/less/twbs-203/grid.less +5 -0
- data/app/assets/packages/burp/editing/dep/FontAwesome/docs/assets/less/twbs-203/hero-unit.less +22 -0
- data/app/assets/packages/burp/editing/dep/FontAwesome/docs/assets/less/twbs-203/labels-badges.less +55 -0
- data/app/assets/packages/burp/editing/dep/FontAwesome/docs/assets/less/twbs-203/layouts.less +17 -0
- data/app/assets/packages/burp/editing/dep/FontAwesome/docs/assets/less/twbs-203/mixins.less +631 -0
- data/app/assets/packages/burp/editing/dep/FontAwesome/docs/assets/less/twbs-203/modals.less +90 -0
- data/app/assets/packages/burp/editing/dep/FontAwesome/docs/assets/less/twbs-203/navbar.less +364 -0
- data/app/assets/packages/burp/editing/dep/FontAwesome/docs/assets/less/twbs-203/navs.less +363 -0
- data/app/assets/packages/burp/editing/dep/FontAwesome/docs/assets/less/twbs-203/pager.less +36 -0
- data/app/assets/packages/burp/editing/dep/FontAwesome/docs/assets/less/twbs-203/pagination.less +56 -0
- data/app/assets/packages/burp/editing/dep/FontAwesome/docs/assets/less/twbs-203/popovers.less +49 -0
- data/app/assets/packages/burp/editing/dep/FontAwesome/docs/assets/less/twbs-203/progress-bars.less +117 -0
- data/app/assets/packages/burp/editing/dep/FontAwesome/docs/assets/less/twbs-203/reset.less +126 -0
- data/app/assets/packages/burp/editing/dep/FontAwesome/docs/assets/less/twbs-203/responsive-1200px-min.less +26 -0
- data/app/assets/packages/burp/editing/dep/FontAwesome/docs/assets/less/twbs-203/responsive-767px-max.less +149 -0
- data/app/assets/packages/burp/editing/dep/FontAwesome/docs/assets/less/twbs-203/responsive-768px-979px.less +17 -0
- data/app/assets/packages/burp/editing/dep/FontAwesome/docs/assets/less/twbs-203/responsive-navbar.less +146 -0
- data/app/assets/packages/burp/editing/dep/FontAwesome/docs/assets/less/twbs-203/responsive-utilities.less +41 -0
- data/app/assets/packages/burp/editing/dep/FontAwesome/docs/assets/less/twbs-203/responsive.less +48 -0
- data/app/assets/packages/burp/editing/dep/FontAwesome/docs/assets/less/twbs-203/scaffolding.less +29 -0
- data/app/assets/packages/burp/editing/dep/FontAwesome/docs/assets/less/twbs-203/sprites.less +191 -0
- data/app/assets/packages/burp/editing/dep/FontAwesome/docs/assets/less/twbs-203/tables.less +176 -0
- data/app/assets/packages/burp/editing/dep/FontAwesome/docs/assets/less/twbs-203/thumbnails.less +47 -0
- data/app/assets/packages/burp/editing/dep/FontAwesome/docs/assets/less/twbs-203/tooltip.less +35 -0
- data/app/assets/packages/burp/editing/dep/FontAwesome/docs/assets/less/twbs-203/type.less +235 -0
- data/app/assets/packages/burp/editing/dep/FontAwesome/docs/assets/less/twbs-203/utilities.less +23 -0
- data/app/assets/packages/burp/editing/dep/FontAwesome/docs/assets/less/twbs-203/variables.less +205 -0
- data/app/assets/packages/burp/editing/dep/FontAwesome/docs/assets/less/twbs-203/wells.less +27 -0
- data/app/assets/packages/burp/editing/dep/FontAwesome/docs/assets/less/variables.less +206 -0
- data/app/assets/packages/burp/editing/dep/FontAwesome/docs/index.html +1087 -0
- data/app/assets/packages/burp/editing/dep/FontAwesome/font/fontawesome-webfont.eot +0 -0
- data/app/assets/packages/burp/editing/dep/FontAwesome/font/fontawesome-webfont.svg +255 -0
- data/app/assets/packages/burp/editing/dep/FontAwesome/font/fontawesome-webfont.ttf +0 -0
- data/app/assets/packages/burp/editing/dep/FontAwesome/font/fontawesome-webfont.woff +0 -0
- data/app/assets/packages/burp/editing/dep/FontAwesome/less/font-awesome-ie7.less +245 -0
- data/app/assets/packages/burp/editing/dep/FontAwesome/less/font-awesome.less +329 -0
- data/app/assets/packages/burp/editing/dep/FontAwesome/sass/font-awesome.sass +712 -0
- data/app/assets/packages/burp/editing/dep/FontAwesome/sass/font-awesome.scss +329 -0
- data/app/assets/packages/burp/editing/js/admin-dock.js +282 -0
- data/app/assets/packages/burp/editing/js/content-decorator.js +321 -0
- data/app/assets/packages/burp/editing/js/main.js +331 -0
- data/app/assets/packages/burp/editing/js/marked.js +781 -0
- data/app/assets/packages/burp/editing/js/md5.js +207 -0
- data/app/assets/packages/burp/editing/js/stay.js +143 -0
- data/app/assets/packages/burp/editing.js +23 -0
- data/app/assets/packages/burp/editing.less +7 -0
- data/app/assets/packages/gritter/README.markdown +57 -0
- data/app/assets/packages/gritter/css/jquery.gritter.less +101 -0
- data/app/assets/packages/gritter/gritter.js +3 -0
- data/app/assets/packages/gritter/gritter.less +3 -0
- data/app/assets/packages/gritter/images/gritter-light.png +0 -0
- data/app/assets/packages/gritter/images/gritter-long.png +0 -0
- data/app/assets/packages/gritter/images/gritter.png +0 -0
- data/app/assets/packages/gritter/images/ie-spacer.gif +0 -0
- data/app/assets/packages/gritter/images/trees.jpg +0 -0
- data/app/assets/packages/gritter/index.html +269 -0
- data/app/assets/packages/gritter/js/jquery.gritter.js +418 -0
- data/app/assets/packages/gritter/js/jquery.gritter.min.js +1 -0
- data/app/assets/stylesheets/burp/application.less +82 -0
- data/app/assets/stylesheets/burp/bootstrap.less +6158 -0
- data/app/assets/stylesheets/burp/docs.less +83 -0
- data/app/assets/stylesheets/burp/fileupload.less +31 -0
- data/app/assets/stylesheets/burp/views/dnd-menu.less +87 -0
- data/app/assets/stylesheets/burp/views/files/index.less +40 -0
- data/app/assets/stylesheets/burp/views/pages/index.less +4 -0
- data/app/assets/stylesheets/burp/views/static/help.less +11 -0
- data/app/controllers/burp/application_controller.rb +45 -0
- data/app/controllers/burp/catch_all_controller.rb +24 -0
- data/app/controllers/burp/error_controller.rb +7 -0
- data/app/controllers/burp/files_controller.rb +92 -0
- data/app/controllers/burp/groups_controller.rb +49 -0
- data/app/controllers/burp/links_controller.rb +48 -0
- data/app/controllers/burp/menus_controller.rb +33 -0
- data/app/controllers/burp/pages_controller.rb +112 -0
- data/app/controllers/burp/static_controller.rb +11 -0
- data/app/helpers/burp/application_helper.rb +4 -0
- data/app/lib/burp/access.rb +63 -0
- data/app/lib/burp/group.rb +110 -0
- data/app/lib/burp/link.rb +66 -0
- data/app/lib/burp/page.rb +23 -0
- data/app/lib/burp/util/upload_handler.rb +84 -0
- data/app/lib/burp/util.rb +39 -0
- data/app/models/burp/file_model.rb +45 -0
- data/app/models/burp/menu.rb +60 -0
- data/app/models/burp/page_model.rb +158 -0
- data/app/views/burp/files/index.html.erb +87 -0
- data/app/views/burp/groups/edit.html.erb +18 -0
- data/app/views/burp/links/edit.html.erb +19 -0
- data/app/views/burp/menus/edit.html.erb +157 -0
- data/app/views/burp/menus/index.html.erb +9 -0
- data/app/views/burp/pages/edit.html.erb +20 -0
- data/app/views/burp/pages/index.html.erb +114 -0
- data/app/views/burp/static/help.html.erb +543 -0
- data/app/views/burp/static/index.html.erb +15 -0
- data/app/views/layouts/burp/application.html.erb +57 -0
- data/config/cucumber.yml +12 -0
- data/config/initializers/bootstrap_form.rb +2 -0
- data/config/routes.rb +30 -0
- data/lib/burp/capistrano.rb +51 -0
- data/lib/burp/engine.rb +15 -0
- data/lib/burp/version.rb +3 -0
- data/lib/burp_cms.rb +64 -0
- data/lib/tasks/burp_tasks.rake +99 -0
- metadata +845 -0
|
@@ -0,0 +1,269 @@
|
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
2
|
+
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
3
|
+
<head>
|
|
4
|
+
<title>Gritter demo for jQuery - boedesign.com</title>
|
|
5
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
6
|
+
<link rel="stylesheet" type="text/css" href="css/jquery.gritter.css" />
|
|
7
|
+
<script type="text/javascript" src="http://www.google.com/jsapi"></script>
|
|
8
|
+
<script type="text/javascript">google.load('jquery', '1.7.1');</script>
|
|
9
|
+
<script type="text/javascript" src="js/jquery.gritter.js"></script>
|
|
10
|
+
<style type="text/css">
|
|
11
|
+
body {
|
|
12
|
+
background:#222 url(images/trees.jpg);
|
|
13
|
+
color:#fff;
|
|
14
|
+
}
|
|
15
|
+
a {
|
|
16
|
+
color:#00ff00;
|
|
17
|
+
}
|
|
18
|
+
#container {
|
|
19
|
+
width:600px;
|
|
20
|
+
background:#333;
|
|
21
|
+
padding:10px;
|
|
22
|
+
}
|
|
23
|
+
</style>
|
|
24
|
+
</head>
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
<body>
|
|
28
|
+
<div id="container">
|
|
29
|
+
<h1>Gritter Demo</h1>
|
|
30
|
+
<p>
|
|
31
|
+
The super awesome background is just to show you that all notifications are transparent!
|
|
32
|
+
<em>Tested in: FF 3+, Opera 9, IE7, IE8, Safari 4+</em>
|
|
33
|
+
</p>
|
|
34
|
+
<ul>
|
|
35
|
+
<li>
|
|
36
|
+
<a href="#" id="add-regular">Add regular notification</a>: Fades out after a certain amount of time, can be set for each notification.
|
|
37
|
+
</li>
|
|
38
|
+
<li>
|
|
39
|
+
<a href="#" id="add-sticky">Add sticky notification</a>: Doesn't run on a fade timer. Just sits there until the user manually removes it by clicking on the (X).
|
|
40
|
+
</li>
|
|
41
|
+
<li>
|
|
42
|
+
<a href="#" id="add-without-image">Add notification without image</a>
|
|
43
|
+
</li>
|
|
44
|
+
<li>
|
|
45
|
+
<a href="#" id="add-gritter-light">Add a white notification</a>: has a 'gritter-light' class_name applied to it.
|
|
46
|
+
</li>
|
|
47
|
+
<li>
|
|
48
|
+
<a href="#" id="add-with-callbacks">Add notification (with callbacks)</a>
|
|
49
|
+
</li>
|
|
50
|
+
<li>
|
|
51
|
+
<a href="#" id="add-sticky-with-callbacks">Add a sticky notification (with callbacks)</a>
|
|
52
|
+
</li>
|
|
53
|
+
<li>
|
|
54
|
+
<a href="#" id="add-max">Add notification with max of 3</a>: If there are 3 messages already on screen, it won't show another one.
|
|
55
|
+
</li>
|
|
56
|
+
<li>
|
|
57
|
+
<a href="#" id="remove-all">Remove all notifications</a>
|
|
58
|
+
</li>
|
|
59
|
+
<li>
|
|
60
|
+
<a href="#" id="remove-all-with-callbacks">Remove all notifications (with callbacks)</a>
|
|
61
|
+
</li>
|
|
62
|
+
</ul>
|
|
63
|
+
</div>
|
|
64
|
+
|
|
65
|
+
<script type="text/javascript">
|
|
66
|
+
|
|
67
|
+
$(function(){
|
|
68
|
+
|
|
69
|
+
// global setting override
|
|
70
|
+
/*
|
|
71
|
+
$.extend($.gritter.options, {
|
|
72
|
+
class_name: 'gritter-light', // for light notifications (can be added directly to $.gritter.add too)
|
|
73
|
+
position: 'bottom-left', // possibilities: bottom-left, bottom-right, top-left, top-right
|
|
74
|
+
fade_in_speed: 100, // how fast notifications fade in (string or int)
|
|
75
|
+
fade_out_speed: 100, // how fast the notices fade out
|
|
76
|
+
time: 3000 // hang on the screen for...
|
|
77
|
+
});
|
|
78
|
+
*/
|
|
79
|
+
|
|
80
|
+
$('#add-sticky').click(function(){
|
|
81
|
+
|
|
82
|
+
var unique_id = $.gritter.add({
|
|
83
|
+
// (string | mandatory) the heading of the notification
|
|
84
|
+
title: 'This is a sticky notice!',
|
|
85
|
+
// (string | mandatory) the text inside the notification
|
|
86
|
+
text: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus eget tincidunt velit. Cum sociis natoque penatibus et <a href="#" style="color:#ccc">magnis dis parturient</a> montes, nascetur ridiculus mus.',
|
|
87
|
+
// (string | optional) the image to display on the left
|
|
88
|
+
image: 'http://s3.amazonaws.com/twitter_production/profile_images/132499022/myface_bigger.jpg',
|
|
89
|
+
// (bool | optional) if you want it to fade out on its own or just sit there
|
|
90
|
+
sticky: true,
|
|
91
|
+
// (int | optional) the time you want it to be alive for before fading out
|
|
92
|
+
time: '',
|
|
93
|
+
// (string | optional) the class name you want to apply to that specific message
|
|
94
|
+
class_name: 'my-sticky-class'
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
// You can have it return a unique id, this can be used to manually remove it later using
|
|
98
|
+
/*
|
|
99
|
+
setTimeout(function(){
|
|
100
|
+
|
|
101
|
+
$.gritter.remove(unique_id, {
|
|
102
|
+
fade: true,
|
|
103
|
+
speed: 'slow'
|
|
104
|
+
});
|
|
105
|
+
|
|
106
|
+
}, 6000)
|
|
107
|
+
*/
|
|
108
|
+
|
|
109
|
+
return false;
|
|
110
|
+
|
|
111
|
+
});
|
|
112
|
+
|
|
113
|
+
$('#add-regular').click(function(){
|
|
114
|
+
|
|
115
|
+
$.gritter.add({
|
|
116
|
+
// (string | mandatory) the heading of the notification
|
|
117
|
+
title: 'This is a regular notice!',
|
|
118
|
+
// (string | mandatory) the text inside the notification
|
|
119
|
+
text: 'This will fade out after a certain amount of time. Vivamus eget tincidunt velit. Cum sociis natoque penatibus et <a href="#" style="color:#ccc">magnis dis parturient</a> montes, nascetur ridiculus mus.',
|
|
120
|
+
// (string | optional) the image to display on the left
|
|
121
|
+
image: 'http://a0.twimg.com/profile_images/59268975/jquery_avatar_bigger.png',
|
|
122
|
+
// (bool | optional) if you want it to fade out on its own or just sit there
|
|
123
|
+
sticky: false,
|
|
124
|
+
// (int | optional) the time you want it to be alive for before fading out
|
|
125
|
+
time: ''
|
|
126
|
+
});
|
|
127
|
+
|
|
128
|
+
return false;
|
|
129
|
+
|
|
130
|
+
});
|
|
131
|
+
|
|
132
|
+
$('#add-max').click(function(){
|
|
133
|
+
|
|
134
|
+
$.gritter.add({
|
|
135
|
+
// (string | mandatory) the heading of the notification
|
|
136
|
+
title: 'This is a notice with a max of 3 on screen at one time!',
|
|
137
|
+
// (string | mandatory) the text inside the notification
|
|
138
|
+
text: 'This will fade out after a certain amount of time. Vivamus eget tincidunt velit. Cum sociis natoque penatibus et <a href="#" style="color:#ccc">magnis dis parturient</a> montes, nascetur ridiculus mus.',
|
|
139
|
+
// (string | optional) the image to display on the left
|
|
140
|
+
image: 'http://a0.twimg.com/profile_images/59268975/jquery_avatar_bigger.png',
|
|
141
|
+
// (bool | optional) if you want it to fade out on its own or just sit there
|
|
142
|
+
sticky: false,
|
|
143
|
+
// (function) before the gritter notice is opened
|
|
144
|
+
before_open: function(){
|
|
145
|
+
if($('.gritter-item-wrapper').length == 3)
|
|
146
|
+
{
|
|
147
|
+
// Returning false prevents a new gritter from opening
|
|
148
|
+
return false;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
});
|
|
152
|
+
|
|
153
|
+
return false;
|
|
154
|
+
|
|
155
|
+
});
|
|
156
|
+
|
|
157
|
+
$('#add-without-image').click(function(){
|
|
158
|
+
|
|
159
|
+
$.gritter.add({
|
|
160
|
+
// (string | mandatory) the heading of the notification
|
|
161
|
+
title: 'This is a notice without an image!',
|
|
162
|
+
// (string | mandatory) the text inside the notification
|
|
163
|
+
text: 'This will fade out after a certain amount of time. Vivamus eget tincidunt velit. Cum sociis natoque penatibus et <a href="#" style="color:#ccc">magnis dis parturient</a> montes, nascetur ridiculus mus.'
|
|
164
|
+
});
|
|
165
|
+
|
|
166
|
+
return false;
|
|
167
|
+
});
|
|
168
|
+
|
|
169
|
+
$('#add-gritter-light').click(function(){
|
|
170
|
+
|
|
171
|
+
$.gritter.add({
|
|
172
|
+
// (string | mandatory) the heading of the notification
|
|
173
|
+
title: 'This is a light notification',
|
|
174
|
+
// (string | mandatory) the text inside the notification
|
|
175
|
+
text: 'Just add a "gritter-light" class_name to your $.gritter.add or globally to $.gritter.options.class_name',
|
|
176
|
+
class_name: 'gritter-light'
|
|
177
|
+
});
|
|
178
|
+
|
|
179
|
+
return false;
|
|
180
|
+
});
|
|
181
|
+
|
|
182
|
+
$('#add-with-callbacks').click(function(){
|
|
183
|
+
|
|
184
|
+
$.gritter.add({
|
|
185
|
+
// (string | mandatory) the heading of the notification
|
|
186
|
+
title: 'This is a notice with callbacks!',
|
|
187
|
+
// (string | mandatory) the text inside the notification
|
|
188
|
+
text: 'The callback is...',
|
|
189
|
+
// (function | optional) function called before it opens
|
|
190
|
+
before_open: function(){
|
|
191
|
+
alert('I am called before it opens');
|
|
192
|
+
},
|
|
193
|
+
// (function | optional) function called after it opens
|
|
194
|
+
after_open: function(e){
|
|
195
|
+
alert("I am called after it opens: \nI am passed the jQuery object for the created Gritter element...\n" + e);
|
|
196
|
+
},
|
|
197
|
+
// (function | optional) function called before it closes
|
|
198
|
+
before_close: function(e, manual_close){
|
|
199
|
+
var manually = (manual_close) ? 'The "X" was clicked to close me!' : '';
|
|
200
|
+
alert("I am called before it closes: I am passed the jQuery object for the Gritter element... \n" + manually);
|
|
201
|
+
},
|
|
202
|
+
// (function | optional) function called after it closes
|
|
203
|
+
after_close: function(e, manual_close){
|
|
204
|
+
var manually = (manual_close) ? 'The "X" was clicked to close me!' : '';
|
|
205
|
+
alert('I am called after it closes. ' + manually);
|
|
206
|
+
}
|
|
207
|
+
});
|
|
208
|
+
|
|
209
|
+
return false;
|
|
210
|
+
});
|
|
211
|
+
|
|
212
|
+
$('#add-sticky-with-callbacks').click(function(){
|
|
213
|
+
|
|
214
|
+
$.gritter.add({
|
|
215
|
+
// (string | mandatory) the heading of the notification
|
|
216
|
+
title: 'This is a sticky notice with callbacks!',
|
|
217
|
+
// (string | mandatory) the text inside the notification
|
|
218
|
+
text: 'Sticky sticky notice.. sticky sticky notice...',
|
|
219
|
+
// Stickeh!
|
|
220
|
+
sticky: true,
|
|
221
|
+
// (function | optional) function called before it opens
|
|
222
|
+
before_open: function(){
|
|
223
|
+
alert('I am a sticky called before it opens');
|
|
224
|
+
},
|
|
225
|
+
// (function | optional) function called after it opens
|
|
226
|
+
after_open: function(e){
|
|
227
|
+
alert("I am a sticky called after it opens: \nI am passed the jQuery object for the created Gritter element...\n" + e);
|
|
228
|
+
},
|
|
229
|
+
// (function | optional) function called before it closes
|
|
230
|
+
before_close: function(e){
|
|
231
|
+
alert("I am a sticky called before it closes: I am passed the jQuery object for the Gritter element... \n" + e);
|
|
232
|
+
},
|
|
233
|
+
// (function | optional) function called after it closes
|
|
234
|
+
after_close: function(){
|
|
235
|
+
alert('I am a sticky called after it closes');
|
|
236
|
+
}
|
|
237
|
+
});
|
|
238
|
+
|
|
239
|
+
return false;
|
|
240
|
+
|
|
241
|
+
});
|
|
242
|
+
|
|
243
|
+
$("#remove-all").click(function(){
|
|
244
|
+
|
|
245
|
+
$.gritter.removeAll();
|
|
246
|
+
return false;
|
|
247
|
+
|
|
248
|
+
});
|
|
249
|
+
|
|
250
|
+
$("#remove-all-with-callbacks").click(function(){
|
|
251
|
+
|
|
252
|
+
$.gritter.removeAll({
|
|
253
|
+
before_close: function(e){
|
|
254
|
+
alert("I am called before all notifications are closed. I am passed the jQuery object containing all of Gritter notifications.\n" + e);
|
|
255
|
+
},
|
|
256
|
+
after_close: function(){
|
|
257
|
+
alert('I am called after everything has been closed.');
|
|
258
|
+
}
|
|
259
|
+
});
|
|
260
|
+
return false;
|
|
261
|
+
|
|
262
|
+
});
|
|
263
|
+
|
|
264
|
+
|
|
265
|
+
});
|
|
266
|
+
</script>
|
|
267
|
+
|
|
268
|
+
</body>
|
|
269
|
+
</html>
|
|
@@ -0,0 +1,418 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Gritter for jQuery
|
|
3
|
+
* http://www.boedesign.com/
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) 2012 Jordan Boesch
|
|
6
|
+
* Dual licensed under the MIT and GPL licenses.
|
|
7
|
+
*
|
|
8
|
+
* Date: February 24, 2012
|
|
9
|
+
* Version: 1.7.4
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
(function($){
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Set it up as an object under the jQuery namespace
|
|
16
|
+
*/
|
|
17
|
+
$.gritter = {};
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Set up global options that the user can over-ride
|
|
21
|
+
*/
|
|
22
|
+
$.gritter.options = {
|
|
23
|
+
position: '',
|
|
24
|
+
class_name: '', // could be set to 'gritter-light' to use white notifications
|
|
25
|
+
fade_in_speed: 'medium', // how fast notifications fade in
|
|
26
|
+
fade_out_speed: 1000, // how fast the notices fade out
|
|
27
|
+
time: 6000 // hang on the screen for...
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Add a gritter notification to the screen
|
|
32
|
+
* @see Gritter#add();
|
|
33
|
+
*/
|
|
34
|
+
$.gritter.add = function(params){
|
|
35
|
+
|
|
36
|
+
try {
|
|
37
|
+
return Gritter.add(params || {});
|
|
38
|
+
} catch(e) {
|
|
39
|
+
|
|
40
|
+
var err = 'Gritter Error: ' + e;
|
|
41
|
+
(typeof(console) != 'undefined' && console.error) ?
|
|
42
|
+
console.error(err, params) :
|
|
43
|
+
alert(err);
|
|
44
|
+
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Remove a gritter notification from the screen
|
|
51
|
+
* @see Gritter#removeSpecific();
|
|
52
|
+
*/
|
|
53
|
+
$.gritter.remove = function(id, params){
|
|
54
|
+
Gritter.removeSpecific(id, params || {});
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Remove all notifications
|
|
59
|
+
* @see Gritter#stop();
|
|
60
|
+
*/
|
|
61
|
+
$.gritter.removeAll = function(params){
|
|
62
|
+
Gritter.stop(params || {});
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Big fat Gritter object
|
|
67
|
+
* @constructor (not really since its object literal)
|
|
68
|
+
*/
|
|
69
|
+
var Gritter = {
|
|
70
|
+
|
|
71
|
+
// Public - options to over-ride with $.gritter.options in "add"
|
|
72
|
+
position: '',
|
|
73
|
+
fade_in_speed: '',
|
|
74
|
+
fade_out_speed: '',
|
|
75
|
+
time: '',
|
|
76
|
+
|
|
77
|
+
// Private - no touchy the private parts
|
|
78
|
+
_custom_timer: 0,
|
|
79
|
+
_item_count: 0,
|
|
80
|
+
_is_setup: 0,
|
|
81
|
+
_tpl_close: '<div class="gritter-close"></div>',
|
|
82
|
+
_tpl_title: '<span class="gritter-title">[[title]]</span>',
|
|
83
|
+
_tpl_item: '<div id="gritter-item-[[number]]" class="gritter-item-wrapper [[item_class]]" style="display:none"><div class="gritter-top"></div><div class="gritter-item">[[close]][[image]]<div class="[[class_name]]">[[title]]<p>[[text]]</p></div><div style="clear:both"></div></div><div class="gritter-bottom"></div></div>',
|
|
84
|
+
_tpl_wrap: '<div id="gritter-notice-wrapper"></div>',
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Add a gritter notification to the screen
|
|
88
|
+
* @param {Object} params The object that contains all the options for drawing the notification
|
|
89
|
+
* @return {Integer} The specific numeric id to that gritter notification
|
|
90
|
+
*/
|
|
91
|
+
add: function(params){
|
|
92
|
+
// Handle straight text
|
|
93
|
+
if(typeof(params) == 'string'){
|
|
94
|
+
params = {text:params};
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
// We might have some issues if we don't have a title or text!
|
|
98
|
+
if(!params.text){
|
|
99
|
+
throw 'You must supply "text" parameter.';
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
// Check the options and set them once
|
|
103
|
+
if(!this._is_setup){
|
|
104
|
+
this._runSetup();
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
// Basics
|
|
108
|
+
var title = params.title,
|
|
109
|
+
text = params.text,
|
|
110
|
+
image = params.image || '',
|
|
111
|
+
sticky = params.sticky || false,
|
|
112
|
+
item_class = params.class_name || $.gritter.options.class_name,
|
|
113
|
+
position = $.gritter.options.position,
|
|
114
|
+
time_alive = params.time || '';
|
|
115
|
+
|
|
116
|
+
this._verifyWrapper();
|
|
117
|
+
|
|
118
|
+
this._item_count++;
|
|
119
|
+
var number = this._item_count,
|
|
120
|
+
tmp = this._tpl_item;
|
|
121
|
+
|
|
122
|
+
// Assign callbacks
|
|
123
|
+
$(['before_open', 'after_open', 'before_close', 'after_close']).each(function(i, val){
|
|
124
|
+
Gritter['_' + val + '_' + number] = ($.isFunction(params[val])) ? params[val] : function(){}
|
|
125
|
+
});
|
|
126
|
+
|
|
127
|
+
// Reset
|
|
128
|
+
this._custom_timer = 0;
|
|
129
|
+
|
|
130
|
+
// A custom fade time set
|
|
131
|
+
if(time_alive){
|
|
132
|
+
this._custom_timer = time_alive;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
var image_str = (image != '') ? '<img src="' + image + '" class="gritter-image" />' : '',
|
|
136
|
+
class_name = (image != '') ? 'gritter-with-image' : 'gritter-without-image';
|
|
137
|
+
|
|
138
|
+
// String replacements on the template
|
|
139
|
+
if(title){
|
|
140
|
+
title = this._str_replace('[[title]]',title,this._tpl_title);
|
|
141
|
+
}else{
|
|
142
|
+
title = '';
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
tmp = this._str_replace(
|
|
146
|
+
['[[title]]', '[[text]]', '[[close]]', '[[image]]', '[[number]]', '[[class_name]]', '[[item_class]]'],
|
|
147
|
+
[title, text, this._tpl_close, image_str, this._item_count, class_name, item_class], tmp
|
|
148
|
+
);
|
|
149
|
+
|
|
150
|
+
// If it's false, don't show another gritter message
|
|
151
|
+
if(this['_before_open_' + number]() === false){
|
|
152
|
+
return false;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
$('#gritter-notice-wrapper').addClass(position).append(tmp);
|
|
156
|
+
|
|
157
|
+
var item = $('#gritter-item-' + this._item_count);
|
|
158
|
+
|
|
159
|
+
item.fadeIn(this.fade_in_speed, function(){
|
|
160
|
+
Gritter['_after_open_' + number]($(this));
|
|
161
|
+
});
|
|
162
|
+
|
|
163
|
+
if(!sticky){
|
|
164
|
+
this._setFadeTimer(item, number);
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
// Bind the hover/unhover states
|
|
168
|
+
$(item).bind('mouseenter mouseleave', function(event){
|
|
169
|
+
if(event.type == 'mouseenter'){
|
|
170
|
+
if(!sticky){
|
|
171
|
+
Gritter._restoreItemIfFading($(this), number);
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
else {
|
|
175
|
+
if(!sticky){
|
|
176
|
+
Gritter._setFadeTimer($(this), number);
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
Gritter._hoverState($(this), event.type);
|
|
180
|
+
});
|
|
181
|
+
|
|
182
|
+
// Clicking (X) makes the perdy thing close
|
|
183
|
+
$(item).find('.gritter-close').click(function(){
|
|
184
|
+
Gritter.removeSpecific(number, {}, null, true);
|
|
185
|
+
});
|
|
186
|
+
|
|
187
|
+
return number;
|
|
188
|
+
|
|
189
|
+
},
|
|
190
|
+
|
|
191
|
+
/**
|
|
192
|
+
* If we don't have any more gritter notifications, get rid of the wrapper using this check
|
|
193
|
+
* @private
|
|
194
|
+
* @param {Integer} unique_id The ID of the element that was just deleted, use it for a callback
|
|
195
|
+
* @param {Object} e The jQuery element that we're going to perform the remove() action on
|
|
196
|
+
* @param {Boolean} manual_close Did we close the gritter dialog with the (X) button
|
|
197
|
+
*/
|
|
198
|
+
_countRemoveWrapper: function(unique_id, e, manual_close){
|
|
199
|
+
|
|
200
|
+
// Remove it then run the callback function
|
|
201
|
+
e.remove();
|
|
202
|
+
this['_after_close_' + unique_id](e, manual_close);
|
|
203
|
+
|
|
204
|
+
// Check if the wrapper is empty, if it is.. remove the wrapper
|
|
205
|
+
if($('.gritter-item-wrapper').length == 0){
|
|
206
|
+
$('#gritter-notice-wrapper').remove();
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
},
|
|
210
|
+
|
|
211
|
+
/**
|
|
212
|
+
* Fade out an element after it's been on the screen for x amount of time
|
|
213
|
+
* @private
|
|
214
|
+
* @param {Object} e The jQuery element to get rid of
|
|
215
|
+
* @param {Integer} unique_id The id of the element to remove
|
|
216
|
+
* @param {Object} params An optional list of params to set fade speeds etc.
|
|
217
|
+
* @param {Boolean} unbind_events Unbind the mouseenter/mouseleave events if they click (X)
|
|
218
|
+
*/
|
|
219
|
+
_fade: function(e, unique_id, params, unbind_events){
|
|
220
|
+
|
|
221
|
+
var params = params || {},
|
|
222
|
+
fade = (typeof(params.fade) != 'undefined') ? params.fade : true,
|
|
223
|
+
fade_out_speed = params.speed || this.fade_out_speed,
|
|
224
|
+
manual_close = unbind_events;
|
|
225
|
+
|
|
226
|
+
this['_before_close_' + unique_id](e, manual_close);
|
|
227
|
+
|
|
228
|
+
// If this is true, then we are coming from clicking the (X)
|
|
229
|
+
if(unbind_events){
|
|
230
|
+
e.unbind('mouseenter mouseleave');
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
// Fade it out or remove it
|
|
234
|
+
if(fade){
|
|
235
|
+
|
|
236
|
+
e.animate({
|
|
237
|
+
opacity: 0
|
|
238
|
+
}, fade_out_speed, function(){
|
|
239
|
+
e.animate({ height: 0 }, 300, function(){
|
|
240
|
+
Gritter._countRemoveWrapper(unique_id, e, manual_close);
|
|
241
|
+
})
|
|
242
|
+
})
|
|
243
|
+
|
|
244
|
+
}
|
|
245
|
+
else {
|
|
246
|
+
|
|
247
|
+
this._countRemoveWrapper(unique_id, e);
|
|
248
|
+
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
},
|
|
252
|
+
|
|
253
|
+
/**
|
|
254
|
+
* Perform actions based on the type of bind (mouseenter, mouseleave)
|
|
255
|
+
* @private
|
|
256
|
+
* @param {Object} e The jQuery element
|
|
257
|
+
* @param {String} type The type of action we're performing: mouseenter or mouseleave
|
|
258
|
+
*/
|
|
259
|
+
_hoverState: function(e, type){
|
|
260
|
+
|
|
261
|
+
// Change the border styles and add the (X) close button when you hover
|
|
262
|
+
if(type == 'mouseenter'){
|
|
263
|
+
|
|
264
|
+
e.addClass('hover');
|
|
265
|
+
|
|
266
|
+
// Show close button
|
|
267
|
+
e.find('.gritter-close').show();
|
|
268
|
+
|
|
269
|
+
}
|
|
270
|
+
// Remove the border styles and hide (X) close button when you mouse out
|
|
271
|
+
else {
|
|
272
|
+
|
|
273
|
+
e.removeClass('hover');
|
|
274
|
+
|
|
275
|
+
// Hide close button
|
|
276
|
+
e.find('.gritter-close').hide();
|
|
277
|
+
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
},
|
|
281
|
+
|
|
282
|
+
/**
|
|
283
|
+
* Remove a specific notification based on an ID
|
|
284
|
+
* @param {Integer} unique_id The ID used to delete a specific notification
|
|
285
|
+
* @param {Object} params A set of options passed in to determine how to get rid of it
|
|
286
|
+
* @param {Object} e The jQuery element that we're "fading" then removing
|
|
287
|
+
* @param {Boolean} unbind_events If we clicked on the (X) we set this to true to unbind mouseenter/mouseleave
|
|
288
|
+
*/
|
|
289
|
+
removeSpecific: function(unique_id, params, e, unbind_events){
|
|
290
|
+
|
|
291
|
+
if(!e){
|
|
292
|
+
var e = $('#gritter-item-' + unique_id);
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
// We set the fourth param to let the _fade function know to
|
|
296
|
+
// unbind the "mouseleave" event. Once you click (X) there's no going back!
|
|
297
|
+
this._fade(e, unique_id, params || {}, unbind_events);
|
|
298
|
+
|
|
299
|
+
},
|
|
300
|
+
|
|
301
|
+
/**
|
|
302
|
+
* If the item is fading out and we hover over it, restore it!
|
|
303
|
+
* @private
|
|
304
|
+
* @param {Object} e The HTML element to remove
|
|
305
|
+
* @param {Integer} unique_id The ID of the element
|
|
306
|
+
*/
|
|
307
|
+
_restoreItemIfFading: function(e, unique_id){
|
|
308
|
+
|
|
309
|
+
clearTimeout(this['_int_id_' + unique_id]);
|
|
310
|
+
e.stop().css({ opacity: '', height: '' });
|
|
311
|
+
|
|
312
|
+
},
|
|
313
|
+
|
|
314
|
+
/**
|
|
315
|
+
* Setup the global options - only once
|
|
316
|
+
* @private
|
|
317
|
+
*/
|
|
318
|
+
_runSetup: function(){
|
|
319
|
+
|
|
320
|
+
for(opt in $.gritter.options){
|
|
321
|
+
this[opt] = $.gritter.options[opt];
|
|
322
|
+
}
|
|
323
|
+
this._is_setup = 1;
|
|
324
|
+
|
|
325
|
+
},
|
|
326
|
+
|
|
327
|
+
/**
|
|
328
|
+
* Set the notification to fade out after a certain amount of time
|
|
329
|
+
* @private
|
|
330
|
+
* @param {Object} item The HTML element we're dealing with
|
|
331
|
+
* @param {Integer} unique_id The ID of the element
|
|
332
|
+
*/
|
|
333
|
+
_setFadeTimer: function(e, unique_id){
|
|
334
|
+
|
|
335
|
+
var timer_str = (this._custom_timer) ? this._custom_timer : this.time;
|
|
336
|
+
this['_int_id_' + unique_id] = setTimeout(function(){
|
|
337
|
+
Gritter._fade(e, unique_id);
|
|
338
|
+
}, timer_str);
|
|
339
|
+
|
|
340
|
+
},
|
|
341
|
+
|
|
342
|
+
/**
|
|
343
|
+
* Bring everything to a halt
|
|
344
|
+
* @param {Object} params A list of callback functions to pass when all notifications are removed
|
|
345
|
+
*/
|
|
346
|
+
stop: function(params){
|
|
347
|
+
|
|
348
|
+
// callbacks (if passed)
|
|
349
|
+
var before_close = ($.isFunction(params.before_close)) ? params.before_close : function(){};
|
|
350
|
+
var after_close = ($.isFunction(params.after_close)) ? params.after_close : function(){};
|
|
351
|
+
|
|
352
|
+
var wrap = $('#gritter-notice-wrapper');
|
|
353
|
+
before_close(wrap);
|
|
354
|
+
wrap.fadeOut(function(){
|
|
355
|
+
$(this).remove();
|
|
356
|
+
after_close();
|
|
357
|
+
});
|
|
358
|
+
|
|
359
|
+
},
|
|
360
|
+
|
|
361
|
+
/**
|
|
362
|
+
* An extremely handy PHP function ported to JS, works well for templating
|
|
363
|
+
* @private
|
|
364
|
+
* @param {String/Array} search A list of things to search for
|
|
365
|
+
* @param {String/Array} replace A list of things to replace the searches with
|
|
366
|
+
* @return {String} sa The output
|
|
367
|
+
*/
|
|
368
|
+
_str_replace: function(search, replace, subject, count){
|
|
369
|
+
|
|
370
|
+
var i = 0, j = 0, temp = '', repl = '', sl = 0, fl = 0,
|
|
371
|
+
f = [].concat(search),
|
|
372
|
+
r = [].concat(replace),
|
|
373
|
+
s = subject,
|
|
374
|
+
ra = r instanceof Array, sa = s instanceof Array;
|
|
375
|
+
s = [].concat(s);
|
|
376
|
+
|
|
377
|
+
if(count){
|
|
378
|
+
this.window[count] = 0;
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
for(i = 0, sl = s.length; i < sl; i++){
|
|
382
|
+
|
|
383
|
+
if(s[i] === ''){
|
|
384
|
+
continue;
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
for (j = 0, fl = f.length; j < fl; j++){
|
|
388
|
+
|
|
389
|
+
temp = s[i] + '';
|
|
390
|
+
repl = ra ? (r[j] !== undefined ? r[j] : '') : r[0];
|
|
391
|
+
s[i] = (temp).split(f[j]).join(repl);
|
|
392
|
+
|
|
393
|
+
if(count && s[i] !== temp){
|
|
394
|
+
this.window[count] += (temp.length-s[i].length) / f[j].length;
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
return sa ? s : s[0];
|
|
401
|
+
|
|
402
|
+
},
|
|
403
|
+
|
|
404
|
+
/**
|
|
405
|
+
* A check to make sure we have something to wrap our notices with
|
|
406
|
+
* @private
|
|
407
|
+
*/
|
|
408
|
+
_verifyWrapper: function(){
|
|
409
|
+
|
|
410
|
+
if($('#gritter-notice-wrapper').length == 0){
|
|
411
|
+
$('body').append(this._tpl_wrap);
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
})(jQuery);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(b){b.gritter={};b.gritter.options={position:"",class_name:"",fade_in_speed:"medium",fade_out_speed:1000,time:6000};b.gritter.add=function(f){try{return a.add(f||{})}catch(d){var c="Gritter Error: "+d;(typeof(console)!="undefined"&&console.error)?console.error(c,f):alert(c)}};b.gritter.remove=function(d,c){a.removeSpecific(d,c||{})};b.gritter.removeAll=function(c){a.stop(c||{})};var a={position:"",fade_in_speed:"",fade_out_speed:"",time:"",_custom_timer:0,_item_count:0,_is_setup:0,_tpl_close:'<div class="gritter-close"></div>',_tpl_title:'<span class="gritter-title">[[title]]</span>',_tpl_item:'<div id="gritter-item-[[number]]" class="gritter-item-wrapper [[item_class]]" style="display:none"><div class="gritter-top"></div><div class="gritter-item">[[close]][[image]]<div class="[[class_name]]">[[title]]<p>[[text]]</p></div><div style="clear:both"></div></div><div class="gritter-bottom"></div></div>',_tpl_wrap:'<div id="gritter-notice-wrapper"></div>',add:function(g){if(typeof(g)=="string"){g={text:g}}if(!g.text){throw'You must supply "text" parameter.'}if(!this._is_setup){this._runSetup()}var k=g.title,n=g.text,e=g.image||"",l=g.sticky||false,m=g.class_name||b.gritter.options.class_name,j=b.gritter.options.position,d=g.time||"";this._verifyWrapper();this._item_count++;var f=this._item_count,i=this._tpl_item;b(["before_open","after_open","before_close","after_close"]).each(function(p,q){a["_"+q+"_"+f]=(b.isFunction(g[q]))?g[q]:function(){}});this._custom_timer=0;if(d){this._custom_timer=d}var c=(e!="")?'<img src="'+e+'" class="gritter-image" />':"",h=(e!="")?"gritter-with-image":"gritter-without-image";if(k){k=this._str_replace("[[title]]",k,this._tpl_title)}else{k=""}i=this._str_replace(["[[title]]","[[text]]","[[close]]","[[image]]","[[number]]","[[class_name]]","[[item_class]]"],[k,n,this._tpl_close,c,this._item_count,h,m],i);if(this["_before_open_"+f]()===false){return false}b("#gritter-notice-wrapper").addClass(j).append(i);var o=b("#gritter-item-"+this._item_count);o.fadeIn(this.fade_in_speed,function(){a["_after_open_"+f](b(this))});if(!l){this._setFadeTimer(o,f)}b(o).bind("mouseenter mouseleave",function(p){if(p.type=="mouseenter"){if(!l){a._restoreItemIfFading(b(this),f)}}else{if(!l){a._setFadeTimer(b(this),f)}}a._hoverState(b(this),p.type)});b(o).find(".gritter-close").click(function(){a.removeSpecific(f,{},null,true)});return f},_countRemoveWrapper:function(c,d,f){d.remove();this["_after_close_"+c](d,f);if(b(".gritter-item-wrapper").length==0){b("#gritter-notice-wrapper").remove()}},_fade:function(g,d,j,f){var j=j||{},i=(typeof(j.fade)!="undefined")?j.fade:true,c=j.speed||this.fade_out_speed,h=f;this["_before_close_"+d](g,h);if(f){g.unbind("mouseenter mouseleave")}if(i){g.animate({opacity:0},c,function(){g.animate({height:0},300,function(){a._countRemoveWrapper(d,g,h)})})}else{this._countRemoveWrapper(d,g)}},_hoverState:function(d,c){if(c=="mouseenter"){d.addClass("hover");d.find(".gritter-close").show()}else{d.removeClass("hover");d.find(".gritter-close").hide()}},removeSpecific:function(c,g,f,d){if(!f){var f=b("#gritter-item-"+c)}this._fade(f,c,g||{},d)},_restoreItemIfFading:function(d,c){clearTimeout(this["_int_id_"+c]);d.stop().css({opacity:"",height:""})},_runSetup:function(){for(opt in b.gritter.options){this[opt]=b.gritter.options[opt]}this._is_setup=1},_setFadeTimer:function(f,d){var c=(this._custom_timer)?this._custom_timer:this.time;this["_int_id_"+d]=setTimeout(function(){a._fade(f,d)},c)},stop:function(e){var c=(b.isFunction(e.before_close))?e.before_close:function(){};var f=(b.isFunction(e.after_close))?e.after_close:function(){};var d=b("#gritter-notice-wrapper");c(d);d.fadeOut(function(){b(this).remove();f()})},_str_replace:function(v,e,o,n){var k=0,h=0,t="",m="",g=0,q=0,l=[].concat(v),c=[].concat(e),u=o,d=c instanceof Array,p=u instanceof Array;u=[].concat(u);if(n){this.window[n]=0}for(k=0,g=u.length;k<g;k++){if(u[k]===""){continue}for(h=0,q=l.length;h<q;h++){t=u[k]+"";m=d?(c[h]!==undefined?c[h]:""):c[0];u[k]=(t).split(l[h]).join(m);if(n&&u[k]!==t){this.window[n]+=(t.length-u[k].length)/l[h].length}}}return p?u:u[0]},_verifyWrapper:function(){if(b("#gritter-notice-wrapper").length==0){b("body").append(this._tpl_wrap)}}}})(jQuery);
|