Permalink
Browse files

moved demo to gh-pages

  • Loading branch information...
1 parent aab2741 commit 40827b998ef960309029afb60a508e94257dab7d @dbremer-tonn dbremer-tonn committed Jan 3, 2011
View
@@ -1,3 +1,5 @@
*.iml
/target/
-/.idea/
+/.idea/
+*.iws
+*.ipr
@@ -1,122 +0,0 @@
-.toast-container {
- width: 280px;
- z-index: 9999;
-}
-
-
-* html .toast-container {
- position: absolute;
-}
-
-.toast-item {
- height: auto;
- background: #333;
- opacity: 0.9;
- -moz-border-radius: 10px;
- -webkit-border-radius: 10px;
- color: #eee;
- padding-top: 20px;
- padding-bottom: 20px;
- padding-left: 6px;
- padding-right: 6px;
- font-family: lucida Grande;
- font-size: 14px;
- border: 2px solid #999;
- display: block;
- position: relative;
- margin: 0 0 12px 0;
-}
-
-.toast-item p {
- text-align: left;
- margin-left: 50px;
-}
-
-.toast-item-close {
- background:url(../images/close.gif);
- width:22px;
- height:22px;
- position: absolute;
- top:7px;
- right:7px;
-}
-
-.toast-item-image {
- width:32px;
- height: 32px;
- margin-left: 10px;
- margin-top: 10px;
- margin-right: 10px;
- float:left;
-}
-
-.toast-item-image-notice {
- background:url(../images/notice.png);
-}
-
-.toast-item-image-success {
- background:url(../images/success.png);
-}
-
-.toast-item-image-warning {
- background:url(../images/warning.png);
-}
-
-.toast-item-image-error {
- background:url(../images/error.png);
-}
-
-
-/**
- * toast types
- *
- * pattern: toast-type-[value]
- * where 'value' is the real value of the plugin option 'type'
- *
- */
-.toast-type-notice {
- color: white;
-}
-
-.toast-type-success {
- color: white;
-}
-
-.toast-type-warning {
- color: white;
- border-color: #FCBD57;
-}
-
-.toast-type-error {
- color: white;
- border-color: #B32B2B;
-}
-
-/**
- * positions
- *
- * pattern: toast-position-[value]
- * where 'value' is the real value of the plugin option 'position'
- *
- */
-.toast-position-top-right {
- position: fixed;
- top: 20px;
- right: 20px;
-}
-
-.toast-position-center {
- position: absolute;
- left: 50%;
- margin-left: -140px;
- margin-top: -40px;
- top: 50%;
-}
-
-.toast-position-middle-bottom {
- position: absolute;
- left: 50%;
- margin-left: -140px;
- margin-top: -40px;
- top: 75%;
-}
View
@@ -1,52 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=MacRoman">
- <link type="text/css" href="css/jquery.toastmessage.css" rel="stylesheet"/>
- <script type="text/javascript" src="jquery-1.4.4.min.js"></script>
- <script type="text/javascript" src="jquery.toastmessage.js"></script>
- <title>toastmessage Test</title>
- </head>
- <body>
- <script type="text/javascript">
- $().toastmessage('showToast', {
- text : 'Success Dialog which is sticky',
- sticky : true,
- position : 'top-right',
- type : 'success',
- closeText: '',
- close : function () {console.log("toast is closed ...");}
- });
- $().toastmessage('showToast', {
- text : 'Notice Dialog which is sticky',
- sticky : true,
- position : 'top-right',
- type : 'notice',
- closeText: '',
- close : function () {console.log("toast is closed ...");}
- });
- $().toastmessage('showToast', {
- text : 'Warning Dialog which is sticky',
- sticky : true,
- position : 'top-right',
- type : 'warning',
- closeText: '',
- close : function () {console.log("toast is closed ...");}
- });
- $().toastmessage('showToast', {
- text : 'Error Dialog which is sticky',
- sticky : true,
- position : 'top-right',
- type : 'error',
- closeText: '',
- close : function () {console.log("toast is closed ...");}
- });
-
- $().toastmessage('showSuccessToast' ,"Success Dialog which is fading away ...");
- $().toastmessage('showNoticeToast', "Notice Dialog which is fading away ...");
- $().toastmessage('showWarningToast', "Warning Dialog which is fading away ...");
- $().toastmessage('showErrorToast', "Error Dialog which is fading away ...");
-
- </script>
- </body>
-</html>
View
Deleted file not rendered
View
Deleted file not rendered
View
Deleted file not rendered
View
Deleted file not rendered
View
Deleted file not rendered
View

Large diffs are not rendered by default.

Oops, something went wrong.
View
@@ -1,161 +0,0 @@
-/*
- * Copyright 2010 akquinet
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/**
- * This JQuery Plugin will help you in showing some nice Toast-Message like notification messages. The behavior is
- * similar to the android Toast class.
- * You have 4 different toast types you can show. Each type comes with its own icon and colored border. The types are:
- * - notice
- * - success
- * - warning
- * - error
- *
- * The following methods will display a toast message:
- *
- * $().toastmessage('showNoticeToast', 'some message here');
- * $().toastmessage('showSuccessToast', "some message here");
- * $().toastmessage('showWarningToast', "some message here");
- * $().toastmessage('showErrorToast', "some message here");
- *
- * // user configured toastmessage:
- * $().toastmessage('showToast', {
- * text : 'Hello World',
- * sticky : true,
- * position : 'top-right',
- * type : 'success',
- * close : function () {console.log("toast is closed ...");}
- * });
- *
- * To see some more examples please have a look into the Tests in src/test/javascript/ToastmessageTest.js
- *
- * For further style configuration please see corresponding css file: jquery-toastmessage.css
- *
- * This plugin is based on the jquery-notice (http://sandbox.timbenniks.com/projects/jquery-notice/)
- * but is enhanced in several ways:
- *
- * configurable positioning
- * convenience methods for different message types
- * callback functionality when closing the toast
- * included some nice free icons
- * reimplemented to follow jquery plugin good practices rules
- *
- * Author: Daniel Bremer-Tonn
-**/
-(function($)
-{
- var settings = {
- inEffect: {opacity: 'show'}, // in effect
- inEffectDuration: 600, // in effect duration in miliseconds
- stayTime: 3000, // time in miliseconds before the item has to disappear
- text: '', // content of the item
- sticky: false, // should the toast item sticky or not?
- type: 'notice', // notice, warning, error, success
- position: 'top-right', // top-right, center, middle-bottom ... Position of the toast container holding different toast. Position can be set only once at the very first call, changing the position after the first call does nothing
- closeText: '', // text which will be shown as close button, set to '' when you want to introduce an image via css
- close: null // callback function when the toastmessage is closed
- };
-
- var methods = {
- init : function(options)
- {
- if (options) {
- $.extend( settings, options );
- }
- },
-
- showToast : function(options)
- {
- var localSettings = {};
- $.extend(localSettings, settings, options);
-
- // declare variables
- var toastWrapAll, toastItemOuter, toastItemInner, toastItemClose, toastItemImage;
-
- toastWrapAll = (!$('.toast-container').length) ? $('<div></div>').addClass('toast-container').addClass('toast-position-' + localSettings.position).appendTo('body') : $('.toast-container');
- toastItemOuter = $('<div></div>').addClass('toast-item-wrapper');
- toastItemInner = $('<div></div>').hide().addClass('toast-item toast-type-' + localSettings.type).appendTo(toastWrapAll).html('<p>'+localSettings.text+'</p>').animate(localSettings.inEffect, localSettings.inEffectDuration).wrap(toastItemOuter);
- toastItemClose = $('<div></div>').addClass('toast-item-close').prependTo(toastItemInner).html(localSettings.closeText).click(function() { $().toastmessage('removeToast',toastItemInner, localSettings) });
- toastItemImage = $('<div></div>').addClass('toast-item-image').addClass('toast-item-image-' + localSettings.type).prependTo(toastItemInner);
-
- if(navigator.userAgent.match(/MSIE 6/i))
- {
- toastWrapAll.css({top: document.documentElement.scrollTop});
- }
-
- if(!localSettings.sticky)
- {
- setTimeout(function()
- {
- $().toastmessage('removeToast', toastItemInner, localSettings);
- },
- localSettings.stayTime);
- }
- return toastItemInner;
- },
-
- showNoticeToast : function (message)
- {
- var options = {text : message, type : 'notice'};
- return $().toastmessage('showToast', options);
- },
-
- showSuccessToast : function (message)
- {
- var options = {text : message, type : 'success'};
- return $().toastmessage('showToast', options);
- },
-
- showErrorToast : function (message)
- {
- var options = {text : message, type : 'error'};
- return $().toastmessage('showToast', options);
- },
-
- showWarningToast : function (message)
- {
- var options = {text : message, type : 'warning'};
- return $().toastmessage('showToast', options);
- },
-
- removeToast: function(obj, options)
- {
- obj.animate({opacity: '0'}, 600, function()
- {
- obj.parent().animate({height: '0px'}, 300, function()
- {
- obj.parent().remove();
- });
- });
- // callback
- if (options && options.close !== null)
- {
- options.close();
- }
- }
- };
-
- $.fn.toastmessage = function( method ) {
-
- // Method calling logic
- if ( methods[method] ) {
- return methods[ method ].apply( this, Array.prototype.slice.call( arguments, 1 ));
- } else if ( typeof method === 'object' || ! method ) {
- return methods.init.apply( this, arguments );
- } else {
- $.error( 'Method ' + method + ' does not exist on jQuery.toastmessage' );
- }
- };
-
-})(jQuery);

0 comments on commit 40827b9

Please sign in to comment.