From e1013a1c20ff8b0b04ec9ea531377f6361194aa5 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 20 Jan 2015 20:11:10 +0100 Subject: [PATCH 01/11] jquery pnotify def file for 2.x --- ...y.pnotify.d.ts => jquery.pnotify-1.x.d.ts} | 0 jquery.pnotify/jquery.pnotify-2.x.d.ts | 157 ++++++++++++++++++ 2 files changed, 157 insertions(+) rename jquery.pnotify/{jquery.pnotify.d.ts => jquery.pnotify-1.x.d.ts} (100%) create mode 100644 jquery.pnotify/jquery.pnotify-2.x.d.ts diff --git a/jquery.pnotify/jquery.pnotify.d.ts b/jquery.pnotify/jquery.pnotify-1.x.d.ts similarity index 100% rename from jquery.pnotify/jquery.pnotify.d.ts rename to jquery.pnotify/jquery.pnotify-1.x.d.ts diff --git a/jquery.pnotify/jquery.pnotify-2.x.d.ts b/jquery.pnotify/jquery.pnotify-2.x.d.ts new file mode 100644 index 000000000..429225dba --- /dev/null +++ b/jquery.pnotify/jquery.pnotify-2.x.d.ts @@ -0,0 +1,157 @@ +interface PNotifyStack { + dir1?: string; + dir2?: string; + push?: string; + spacing1?: number; + spacing2?: number; + context?: JQuery +} + +interface PNotifyLabel { + redisplay?: string; + all?: string; + last?: string; + close?: string; + stick?: string; +} + +interface PNotifyOptions { + /** + * The notice's title. Either boolean false or string + */ + title?: any; + /** + * Whether to escape the content of the title. (Not allow HTML.) + */ + title_escape?: boolean; + /** + * The notice's text. Either boolean false or string + */ + text?: any; + /** + * Whether to escape the content of the text. (Not allow HTML.) + */ + text_escape?: boolean; + /** + * What styling classes to use. (Can be either jqueryui or bootstrap.) + */ + styling?: string; + /** + * Additional classes to be added to the notice. (For custom styling.) + */ + addclass?: string; + /** + * Class to be added to the notice for corner styling. + */ + cornerclass?: string; + /** + * Create a non-blocking notice. It lets the user click elements underneath it. + */ + nonblock?: boolean; + /** + * The opacity of the notice (if it's non-blocking) when the mouse is over it. + */ + nonblock_opacity?: number; + /** + * Display a pull down menu to redisplay previous notices, and place the notice in the history. + */ + history?: boolean; + /** + * Maximum number of notifications to have onscreen. + */ + maxonscreen?: number; + /** + * Display the notice when it is created. Turn this off to add notifications to the history without displaying them. + */ + auto_display?: boolean; + /** + * Width of the notice. + */ + width?: string; + /** + * Minimum height of the notice. It will expand to fit content. + */ + min_height?: string; + /** + * Type of the notice. "notice", "info", "success", or "error". + */ + type?: string; + /** + * Set icon to true to use the default icon for the selected style/type, false for no icon, or a string for your own icon class. + */ + icon?: any; + /** + * The animation to use when displaying and hiding the notice. "none", "show", "fade", and "slide" are built in to jQuery. Others require jQuery UI. Use an object with effect_in and effect_out to use different effects. + */ + animation?: any; + /** + * Speed at which the notice animates in and out. "slow", "def" or "normal", "fast" or number of milliseconds. + */ + animate_speed?: string; + /** + * Specify a specific duration of position animation + */ + position_animate_speed?: number; + /** + * Opacity of the notice. + */ + opacity?: number; + /** + * Display a drop shadow. + */ + shadow?: boolean; + /** + * Provide a button for the user to manually close the notice. + */ + closer?: boolean; + /** + * Only show the closer button on hover. + */ + closer_hover?: boolean; + /** + * Provide a button for the user to manually stick the notice. + */ + sticker?: boolean; + /** + * Only show the sticker button on hover. + */ + sticker_hover?: boolean; + /** + * After a delay, remove the notice. + */ + hide?: boolean; + /** + * Delay in milliseconds before the notice is removed. + */ + delay?: number; + /** + * Reset the hide timer if the mouse moves over the notice. + */ + mouse_reset?: boolean; + /** + * Remove the notice's elements from the DOM after it is removed. + */ + remove?: boolean; + /** + * Change new lines to br tags. + */ + insert_brs?: boolean; + /** + * The stack on which the notices will be placed. Also controls the direction the notices stack. + */ + stack?: PNotifyStack; + /** + * The various displayed text, helps facilitating internationalization. + */ + labels?: PNotifyLabel; +} + +interface PNotify { + update(options?: PNotifyOptions); +} + +interface PNotifyConstructor { + new (options?: PNotifyOptions): PNotify; +} + +declare var PNotify: PNotifyConstructor; From 85116cafcd30137d1ed69debf664737a03c64a3f Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 21 Jan 2015 16:32:06 +0100 Subject: [PATCH 02/11] updated buttons definition --- jquery.pnotify/jquery.pnotify-2.x.d.ts | 287 +++++++++++++------------ 1 file changed, 149 insertions(+), 138 deletions(-) diff --git a/jquery.pnotify/jquery.pnotify-2.x.d.ts b/jquery.pnotify/jquery.pnotify-2.x.d.ts index 429225dba..31c9173d0 100644 --- a/jquery.pnotify/jquery.pnotify-2.x.d.ts +++ b/jquery.pnotify/jquery.pnotify-2.x.d.ts @@ -1,153 +1,164 @@ interface PNotifyStack { - dir1?: string; - dir2?: string; - push?: string; - spacing1?: number; - spacing2?: number; - context?: JQuery + dir1?: string; + dir2?: string; + push?: string; + spacing1?: number; + spacing2?: number; + context?: JQuery } interface PNotifyLabel { - redisplay?: string; - all?: string; - last?: string; - close?: string; - stick?: string; + redisplay?: string; + all?: string; + last?: string; + close?: string; + stick?: string; } interface PNotifyOptions { /** - * The notice's title. Either boolean false or string - */ - title?: any; - /** - * Whether to escape the content of the title. (Not allow HTML.) - */ - title_escape?: boolean; - /** - * The notice's text. Either boolean false or string - */ - text?: any; - /** - * Whether to escape the content of the text. (Not allow HTML.) - */ - text_escape?: boolean; - /** - * What styling classes to use. (Can be either jqueryui or bootstrap.) - */ - styling?: string; - /** - * Additional classes to be added to the notice. (For custom styling.) - */ - addclass?: string; - /** - * Class to be added to the notice for corner styling. - */ - cornerclass?: string; - /** - * Create a non-blocking notice. It lets the user click elements underneath it. - */ - nonblock?: boolean; - /** - * The opacity of the notice (if it's non-blocking) when the mouse is over it. - */ - nonblock_opacity?: number; - /** - * Display a pull down menu to redisplay previous notices, and place the notice in the history. - */ - history?: boolean; - /** - * Maximum number of notifications to have onscreen. - */ - maxonscreen?: number; - /** - * Display the notice when it is created. Turn this off to add notifications to the history without displaying them. - */ - auto_display?: boolean; - /** - * Width of the notice. - */ - width?: string; - /** - * Minimum height of the notice. It will expand to fit content. - */ - min_height?: string; - /** - * Type of the notice. "notice", "info", "success", or "error". - */ - type?: string; - /** - * Set icon to true to use the default icon for the selected style/type, false for no icon, or a string for your own icon class. - */ - icon?: any; - /** - * The animation to use when displaying and hiding the notice. "none", "show", "fade", and "slide" are built in to jQuery. Others require jQuery UI. Use an object with effect_in and effect_out to use different effects. - */ - animation?: any; - /** - * Speed at which the notice animates in and out. "slow", "def" or "normal", "fast" or number of milliseconds. - */ - animate_speed?: string; - /** - * Specify a specific duration of position animation - */ - position_animate_speed?: number; - /** - * Opacity of the notice. - */ - opacity?: number; - /** - * Display a drop shadow. - */ - shadow?: boolean; - /** - * Provide a button for the user to manually close the notice. - */ - closer?: boolean; - /** - * Only show the closer button on hover. - */ - closer_hover?: boolean; - /** - * Provide a button for the user to manually stick the notice. - */ - sticker?: boolean; - /** - * Only show the sticker button on hover. - */ - sticker_hover?: boolean; - /** - * After a delay, remove the notice. - */ - hide?: boolean; - /** - * Delay in milliseconds before the notice is removed. - */ - delay?: number; - /** - * Reset the hide timer if the mouse moves over the notice. - */ - mouse_reset?: boolean; - /** - * Remove the notice's elements from the DOM after it is removed. - */ - remove?: boolean; - /** - * Change new lines to br tags. - */ - insert_brs?: boolean; - /** - * The stack on which the notices will be placed. Also controls the direction the notices stack. - */ - stack?: PNotifyStack; - /** - * The various displayed text, helps facilitating internationalization. - */ - labels?: PNotifyLabel; + * The notice's title. Either boolean false or string + */ + title?: any; + /** + * Whether to escape the content of the title. (Not allow HTML.) + */ + title_escape?: boolean; + /** + * The notice's text. Either boolean false or string + */ + text?: any; + /** + * Whether to escape the content of the text. (Not allow HTML.) + */ + text_escape?: boolean; + /** + * What styling classes to use. (Can be either jqueryui or bootstrap.) + */ + styling?: string; + /** + * Additional classes to be added to the notice. (For custom styling.) + */ + addclass?: string; + /** + * Class to be added to the notice for corner styling. + */ + cornerclass?: string; + + nonblock?: { + /** + * Create a non-blocking notice. It lets the user click elements underneath it. + */ + nonblock: boolean; + + /** + * The opacity of the notice (if it's non-blocking) when the mouse is over it. + */ + nonblock_opacity?: number + }; + + /** + * Display a pull down menu to redisplay previous notices, and place the notice in the history. + */ + history?: boolean; + /** + * Maximum number of notifications to have onscreen. + */ + maxonscreen?: number; + /** + * Display the notice when it is created. Turn this off to add notifications to the history without displaying them. + */ + auto_display?: boolean; + /** + * Width of the notice. + */ + width?: string; + /** + * Minimum height of the notice. It will expand to fit content. + */ + min_height?: string; + /** + * Type of the notice. "notice", "info", "success", or "error". + */ + type?: string; + /** + * Set icon to true to use the default icon for the selected style/type, false for no icon, or a string for your own icon class. + */ + icon?: any; + /** + * The animation to use when displaying and hiding the notice. "none", "show", "fade", and "slide" are built in to jQuery. Others require jQuery UI. Use an object with effect_in and effect_out to use different effects. + */ + animation?: any; + /** + * Speed at which the notice animates in and out. "slow", "def" or "normal", "fast" or number of milliseconds. + */ + animate_speed?: string; + /** + * Specify a specific duration of position animation + */ + position_animate_speed?: number; + /** + * Opacity of the notice. + */ + opacity?: number; + /** + * Display a drop shadow. + */ + shadow?: boolean; + + buttons?: { + /** + * Provide a button for the user to manually close the notice. + */ + closer?: boolean; + /** + * Only show the closer button on hover. + */ + closer_hover?: boolean; + + /** + * Provide a button for the user to manually stick the notice. + */ + sticker?: boolean; + /** + * Only show the sticker button on hover. + */ + sticker_hover?: boolean; + } + + /** + * After a delay, remove the notice. + */ + hide?: boolean; + /** + * Delay in milliseconds before the notice is removed. + */ + delay?: number; + /** + * Reset the hide timer if the mouse moves over the notice. + */ + mouse_reset?: boolean; + /** + * Remove the notice's elements from the DOM after it is removed. + */ + remove?: boolean; + /** + * Change new lines to br tags. + */ + insert_brs?: boolean; + /** + * The stack on which the notices will be placed. Also controls the direction the notices stack. + */ + stack?: PNotifyStack; + /** + * The various displayed text, helps facilitating internationalization. + */ + labels?: PNotifyLabel; } interface PNotify { update(options?: PNotifyOptions); + remove(); } interface PNotifyConstructor { From ddd17352ec59f4e687a4091cf9b3f3c4d976fcfd Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 21 Jan 2015 16:34:18 +0100 Subject: [PATCH 03/11] fixed test --- jquery.pnotify/jquery.pnotify-tests.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jquery.pnotify/jquery.pnotify-tests.ts b/jquery.pnotify/jquery.pnotify-tests.ts index 779b32b16..a14f847d5 100644 --- a/jquery.pnotify/jquery.pnotify-tests.ts +++ b/jquery.pnotify/jquery.pnotify-tests.ts @@ -1,5 +1,5 @@ /// -/// +/// function test_pnotify() { From 08a30f6528f9dac7d45aa54cf2398bf021e83317 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 21 Jan 2015 16:40:24 +0100 Subject: [PATCH 04/11] added description --- jquery.pnotify/jquery.pnotify-2.x.d.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/jquery.pnotify/jquery.pnotify-2.x.d.ts b/jquery.pnotify/jquery.pnotify-2.x.d.ts index 31c9173d0..adde9bee8 100644 --- a/jquery.pnotify/jquery.pnotify-2.x.d.ts +++ b/jquery.pnotify/jquery.pnotify-2.x.d.ts @@ -1,3 +1,8 @@ +// Type definitions for jquery.pnotify 2.x +// Project: https://github.com/sciactive/pnotify +// Definitions by: David Sichau & Louis Grignon +// Definitions: https://github.com/borisyankov/DefinitelyTyped + interface PNotifyStack { dir1?: string; dir2?: string; From 48dd05e483a3a9cfb328f345e9bc53eb6b287713 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 21 Jan 2015 16:50:43 +0100 Subject: [PATCH 05/11] fixed description --- jquery.pnotify/jquery.pnotify-2.x.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jquery.pnotify/jquery.pnotify-2.x.d.ts b/jquery.pnotify/jquery.pnotify-2.x.d.ts index adde9bee8..c25aac8e0 100644 --- a/jquery.pnotify/jquery.pnotify-2.x.d.ts +++ b/jquery.pnotify/jquery.pnotify-2.x.d.ts @@ -1,6 +1,6 @@ // Type definitions for jquery.pnotify 2.x // Project: https://github.com/sciactive/pnotify -// Definitions by: David Sichau & Louis Grignon +// Definitions by: Louis Grignon // Definitions: https://github.com/borisyankov/DefinitelyTyped interface PNotifyStack { From 8f88052a53f13ee8db2078995e3fd838caa39b84 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 22 Jan 2015 10:53:32 +0100 Subject: [PATCH 06/11] removed jquery dependency (not required anymore ?) --- jquery.pnotify/jquery.pnotify-2.x.d.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/jquery.pnotify/jquery.pnotify-2.x.d.ts b/jquery.pnotify/jquery.pnotify-2.x.d.ts index c25aac8e0..58dec29f0 100644 --- a/jquery.pnotify/jquery.pnotify-2.x.d.ts +++ b/jquery.pnotify/jquery.pnotify-2.x.d.ts @@ -9,7 +9,6 @@ interface PNotifyStack { push?: string; spacing1?: number; spacing2?: number; - context?: JQuery } interface PNotifyLabel { From 1dab5f7be3dadcebb1c06659e58b78cf4b61f21b Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 22 Jan 2015 11:05:42 +0100 Subject: [PATCH 07/11] added jquery dependency and enhanced interface --- jquery.pnotify/jquery.pnotify-2.x.d.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/jquery.pnotify/jquery.pnotify-2.x.d.ts b/jquery.pnotify/jquery.pnotify-2.x.d.ts index 58dec29f0..167afcf23 100644 --- a/jquery.pnotify/jquery.pnotify-2.x.d.ts +++ b/jquery.pnotify/jquery.pnotify-2.x.d.ts @@ -3,12 +3,15 @@ // Definitions by: Louis Grignon // Definitions: https://github.com/borisyankov/DefinitelyTyped +/// + interface PNotifyStack { dir1?: string; dir2?: string; push?: string; spacing1?: number; spacing2?: number; + context?: JQuery } interface PNotifyLabel { @@ -161,8 +164,10 @@ interface PNotifyOptions { } interface PNotify { - update(options?: PNotifyOptions); - remove(); + elem: JQuery; + + update(options?: PNotifyOptions): void; + remove(): void; } interface PNotifyConstructor { From 491db261ceaa7a0ad24ed124724d16b1b293b916 Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 25 Jan 2015 13:50:26 +0100 Subject: [PATCH 08/11] v2 replaces v1 --- jquery.pnotify/{jquery.pnotify-2.x.d.ts => jquery.pnotify.d.ts} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename jquery.pnotify/{jquery.pnotify-2.x.d.ts => jquery.pnotify.d.ts} (100%) diff --git a/jquery.pnotify/jquery.pnotify-2.x.d.ts b/jquery.pnotify/jquery.pnotify.d.ts similarity index 100% rename from jquery.pnotify/jquery.pnotify-2.x.d.ts rename to jquery.pnotify/jquery.pnotify.d.ts From 9dafbcba48e3af3edcb3e4fe24b16c84dd3ec7e7 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 27 Jan 2015 10:20:16 +0100 Subject: [PATCH 09/11] fixed indentation and updated authors --- jquery.pnotify/jquery.pnotify-tests.ts | 95 ++++---- jquery.pnotify/jquery.pnotify.d.ts | 300 +++++++++++++------------ 2 files changed, 202 insertions(+), 193 deletions(-) diff --git a/jquery.pnotify/jquery.pnotify-tests.ts b/jquery.pnotify/jquery.pnotify-tests.ts index a14f847d5..e32dc99ae 100644 --- a/jquery.pnotify/jquery.pnotify-tests.ts +++ b/jquery.pnotify/jquery.pnotify-tests.ts @@ -1,212 +1,218 @@ /// -/// +/// function test_pnotify() { - $.pnotify({ + new PNotify({ title: 'Regular Notice', text: 'Check me out! I\'m a notice.' }); - $.pnotify({ + new PNotify({ title: 'Sticky Notice', text: 'Check me out! I\'m a sticky notice. You\'ll have to close me yourself.', hide: false }); - $.pnotify({ + new PNotify({ title: 'See Through Notice', text: 'No one ever pays attention to me. Why should they? I\'m practically invisible.', opacity: .8 }); - $.pnotify({ + new PNotify({ title: 'No Shadow Notice', text: 'I don\'t have a shadow. (It\'s cause I\'m a vampire or something. Or is that reflections...)', shadow: false }); - $.pnotify('Check me out! I\'m a notice.'); + new PNotify('Check me out! I\'m a notice.'); - $.pnotify(Math.round(Math.random() * 9999)); + new PNotify(Math.round(Math.random() * 9999)); - $.pnotify({ + new PNotify({ title: 'PIcon Notice', text: 'I have an icon that uses the PIcon styles.', icon: 'picon picon-mail-unread-new' }); - $.pnotify({ + new PNotify({ title: 'jQuery UI Icon Notice', text: 'I have an icon that uses the jQuery UI icon styles.', icon: 'ui-icon ui-icon-mail-closed' }); - $.pnotify({ + new PNotify({ title: 'Bootstrap Icon Notice', text: 'I have an icon that uses the Bootstrap icon styles.', icon: 'glyphicon glyphicon-envelope' }); - $.pnotify({ + new PNotify({ title: 'No Icon Notice', text: 'I have no icon.', icon: false }); - $.pnotify({ + new PNotify({ title: 'Bootstrap Notice', text: 'Look at my beautiful styling! ^_^', styling: 'bootstrap3' }); - $.pnotify({ + new PNotify({ title: 'Bootstrap Info', text: 'Look at my beautiful styling! ^_^', type: 'info', styling: 'bootstrap3' }); - $.pnotify({ + new PNotify({ title: 'Bootstrap Success', text: 'Look at my beautiful styling! ^_^', type: 'success', styling: 'bootstrap3' }); - $.pnotify({ + new PNotify({ title: 'Bootstrap Error', text: 'Look at my beautiful styling! ^_^', type: 'error', styling: 'bootstrap3' }); - $.pnotify({ + new PNotify({ title: 'jQuery UI Notice', text: 'Look at my beautiful styling! ^_^', styling: 'jqueryui' }); - $.pnotify({ + new PNotify({ title: 'jQuery UI Info', text: 'Look at my beautiful styling! ^_^', type: 'info', styling: 'jqueryui' }); - $.pnotify({ + new PNotify({ title: 'jQuery UI Success', text: 'Look at my beautiful styling! ^_^', type: 'success', styling: 'jqueryui' }); - $.pnotify({ + new PNotify({ title: 'jQuery UI Error', text: 'Look at my beautiful styling! ^_^', type: 'error', styling: 'jqueryui' }); - $.pnotify({ + new PNotify({ title: 'Font Awesome Notice', text: 'Look at my beautiful styling! ^_^', styling: 'fontawesome' }); - $.pnotify({ + new PNotify({ title: 'Font Awesome Info', text: 'Look at my beautiful styling! ^_^', type: 'info', styling: 'fontawesome' }); - $.pnotify({ + new PNotify({ title: 'Font Awesome Success', text: 'Look at my beautiful styling! ^_^', type: 'success', styling: 'fontawesome' }); - $.pnotify({ + new PNotify({ title: 'Font Awesome Error', text: 'Look at my beautiful styling! ^_^', type: 'error', styling: 'fontawesome' }); - $.pnotify({ + new PNotify({ title: 'New Thing', text: 'Just to let you know, something happened.', type: 'info' }); - $.pnotify({ + new PNotify({ title: 'Sticky Info', text: 'Sticky info, you know, like a newspaper covered in honey.', type: 'info', hide: false }); - $.pnotify({ + new PNotify({ title: 'See Through Info', text: 'Not only does it not matter, but I don\'t even care if you see this info.', type: 'info', opacity: .8 }); - $.pnotify({ + new PNotify({ title: 'No Shadow Success', text: 'I don\'t have a shadow. (It\'s cause I\'m a vampire or something. Or is that reflections...)', type: 'success', shadow: false }); - $.pnotify({ + new PNotify({ title: 'PIcon Success', text: 'We reached the moon first! See, we planted a flag.', type: 'success', icon: 'picon picon-flag-green' }); - $.pnotify({ + new PNotify({ title: 'Oh No!', text: 'Something terrible happened.', type: 'error' }); - $.pnotify({ + new PNotify({ title: 'No Icon Error', text: 'I have no icon.', type: 'error', icon: false }); - $.pnotify({ + new PNotify({ title: 'No Sticky Button Notice', text: 'Check me out! I\'m a sticky notice with no unsticky button. You\'ll have to close me yourself.', hide: false, - sticker: false + buttons: { + sticker: false + } }); - $.pnotify({ + new PNotify({ title: 'No Mouse Reset Notice', text: 'I don\'t care if you move your mouse over me, I\'ll disappear when I want.', mouse_reset: false }); - $.pnotify({ + new PNotify({ title: 'Escaped Notice', title_escape: true, text: $('#evil_html').html(), text_escape: true }); - $.pnotify({ + new PNotify({ title: 'Non-Blocking Notice', text: 'I\'m a special kind of notice called "non-blocking". When you hover over me I\'ll fade to show the elements underneath. Feel free to click any of them just like I wasn\'t even here.\n\nNote: HTML links don\'t trigger in some browsers, due to security settings.', - nonblock: true, - nonblock_opacity: .2 + nonblock: { + nonblock: true, + nonblock_opacity: .2 + } }); - $.pnotify({ + new PNotify({ title: 'Custom Styling', text: 'I have an additional class that\'s used to give me special styling. I always wanted to be pretty.', addclass: 'custom', icon: 'picon picon-32 picon-fill-color', opacity: .8, - nonblock: true, - nonblock_opacity: .2 + nonblock: { + nonblock: true, + nonblock_opacity: .2 + } }); - $.pnotify({ + new PNotify({ title: "PNotify Stacks", text: "Stacks are used to position notices and determine where new notices will go when they're created. Each notice that's placed into a stack will be positioned related to the other notices in that stack. There is no limit to the number of stacks, and no limit to the number of notices in each stack.", type: "info", @@ -229,14 +235,13 @@ function test_pnotify() { type: "error" }; - $.pnotify(opts); + new PNotify(opts); - $.pnotify({ + new PNotify({ title: 'Show Effect', text: 'I use a different effect.', animation: 'show' }); - $.pnotify_remove_all(); - + PNotify.removeAll(); } diff --git a/jquery.pnotify/jquery.pnotify.d.ts b/jquery.pnotify/jquery.pnotify.d.ts index 167afcf23..13fd82d7a 100644 --- a/jquery.pnotify/jquery.pnotify.d.ts +++ b/jquery.pnotify/jquery.pnotify.d.ts @@ -1,177 +1,181 @@ // Type definitions for jquery.pnotify 2.x // Project: https://github.com/sciactive/pnotify +// Definitions by: David Sichau // Definitions by: Louis Grignon // Definitions: https://github.com/borisyankov/DefinitelyTyped /// interface PNotifyStack { - dir1?: string; - dir2?: string; - push?: string; - spacing1?: number; - spacing2?: number; - context?: JQuery + dir1?: string; + dir2?: string; + push?: string; + spacing1?: number; + spacing2?: number; + context?: JQuery } interface PNotifyLabel { - redisplay?: string; - all?: string; - last?: string; - close?: string; - stick?: string; + redisplay?: string; + all?: string; + last?: string; + close?: string; + stick?: string; } interface PNotifyOptions { - /** - * The notice's title. Either boolean false or string - */ - title?: any; - /** - * Whether to escape the content of the title. (Not allow HTML.) - */ - title_escape?: boolean; - /** - * The notice's text. Either boolean false or string - */ - text?: any; - /** - * Whether to escape the content of the text. (Not allow HTML.) - */ - text_escape?: boolean; - /** - * What styling classes to use. (Can be either jqueryui or bootstrap.) - */ - styling?: string; - /** - * Additional classes to be added to the notice. (For custom styling.) - */ - addclass?: string; - /** - * Class to be added to the notice for corner styling. - */ - cornerclass?: string; + /** + * The notice's title. Either boolean false or string + */ + title?: any; + /** + * Whether to escape the content of the title. (Not allow HTML.) + */ + title_escape?: boolean; + /** + * The notice's text. Either boolean false or string + */ + text?: any; + /** + * Whether to escape the content of the text. (Not allow HTML.) + */ + text_escape?: boolean; + /** + * What styling classes to use. (Can be either jqueryui or bootstrap.) + */ + styling?: string; + /** + * Additional classes to be added to the notice. (For custom styling.) + */ + addclass?: string; + /** + * Class to be added to the notice for corner styling. + */ + cornerclass?: string; - nonblock?: { - /** - * Create a non-blocking notice. It lets the user click elements underneath it. - */ - nonblock: boolean; + nonblock?: { + /** + * Create a non-blocking notice. It lets the user click elements underneath it. + */ + nonblock: boolean; - /** - * The opacity of the notice (if it's non-blocking) when the mouse is over it. - */ - nonblock_opacity?: number - }; + /** + * The opacity of the notice (if it's non-blocking) when the mouse is over it. + */ + nonblock_opacity?: number + }; - /** - * Display a pull down menu to redisplay previous notices, and place the notice in the history. - */ - history?: boolean; - /** - * Maximum number of notifications to have onscreen. - */ - maxonscreen?: number; - /** - * Display the notice when it is created. Turn this off to add notifications to the history without displaying them. - */ - auto_display?: boolean; - /** - * Width of the notice. - */ - width?: string; - /** - * Minimum height of the notice. It will expand to fit content. - */ - min_height?: string; - /** - * Type of the notice. "notice", "info", "success", or "error". - */ - type?: string; - /** - * Set icon to true to use the default icon for the selected style/type, false for no icon, or a string for your own icon class. - */ - icon?: any; - /** - * The animation to use when displaying and hiding the notice. "none", "show", "fade", and "slide" are built in to jQuery. Others require jQuery UI. Use an object with effect_in and effect_out to use different effects. - */ - animation?: any; - /** - * Speed at which the notice animates in and out. "slow", "def" or "normal", "fast" or number of milliseconds. - */ - animate_speed?: string; - /** - * Specify a specific duration of position animation - */ - position_animate_speed?: number; - /** - * Opacity of the notice. - */ - opacity?: number; - /** - * Display a drop shadow. - */ - shadow?: boolean; + /** + * Display a pull down menu to redisplay previous notices, and place the notice in the history. + */ + history?: boolean; + /** + * Maximum number of notifications to have onscreen. + */ + maxonscreen?: number; + /** + * Display the notice when it is created. Turn this off to add notifications to the history without displaying them. + */ + auto_display?: boolean; + /** + * Width of the notice. + */ + width?: string; + /** + * Minimum height of the notice. It will expand to fit content. + */ + min_height?: string; + /** + * Type of the notice. "notice", "info", "success", or "error". + */ + type?: string; + /** + * Set icon to true to use the default icon for the selected style/type, false for no icon, or a string for your own icon class. + */ + icon?: any; + /** + * The animation to use when displaying and hiding the notice. "none", "show", "fade", and "slide" are built in to jQuery. Others require jQuery UI. Use an object with effect_in and effect_out to use different effects. + */ + animation?: any; + /** + * Speed at which the notice animates in and out. "slow", "def" or "normal", "fast" or number of milliseconds. + */ + animate_speed?: string; + /** + * Specify a specific duration of position animation + */ + position_animate_speed?: number; + /** + * Opacity of the notice. + */ + opacity?: number; + /** + * Display a drop shadow. + */ + shadow?: boolean; - buttons?: { - /** - * Provide a button for the user to manually close the notice. - */ - closer?: boolean; - /** - * Only show the closer button on hover. - */ - closer_hover?: boolean; + buttons?: { + /** + * Provide a button for the user to manually close the notice. + */ + closer?: boolean; + /** + * Only show the closer button on hover. + */ + closer_hover?: boolean; - /** - * Provide a button for the user to manually stick the notice. - */ - sticker?: boolean; - /** - * Only show the sticker button on hover. - */ - sticker_hover?: boolean; - } + /** + * Provide a button for the user to manually stick the notice. + */ + sticker?: boolean; + /** + * Only show the sticker button on hover. + */ + sticker_hover?: boolean; + } - /** - * After a delay, remove the notice. - */ - hide?: boolean; - /** - * Delay in milliseconds before the notice is removed. - */ - delay?: number; - /** - * Reset the hide timer if the mouse moves over the notice. - */ - mouse_reset?: boolean; - /** - * Remove the notice's elements from the DOM after it is removed. - */ - remove?: boolean; - /** - * Change new lines to br tags. - */ - insert_brs?: boolean; - /** - * The stack on which the notices will be placed. Also controls the direction the notices stack. - */ - stack?: PNotifyStack; - /** - * The various displayed text, helps facilitating internationalization. - */ - labels?: PNotifyLabel; + /** + * After a delay, remove the notice. + */ + hide?: boolean; + /** + * Delay in milliseconds before the notice is removed. + */ + delay?: number; + /** + * Reset the hide timer if the mouse moves over the notice. + */ + mouse_reset?: boolean; + /** + * Remove the notice's elements from the DOM after it is removed. + */ + remove?: boolean; + /** + * Change new lines to br tags. + */ + insert_brs?: boolean; + /** + * The stack on which the notices will be placed. Also controls the direction the notices stack. + */ + stack?: PNotifyStack; + /** + * The various displayed text, helps facilitating internationalization. + */ + labels?: PNotifyLabel; } interface PNotify { - elem: JQuery; - - update(options?: PNotifyOptions): void; - remove(): void; + elem: JQuery; + + update(options?: PNotifyOptions): void; + remove(): void; } interface PNotifyConstructor { - new (options?: PNotifyOptions): PNotify; + new (options?: PNotifyOptions): PNotify; + + removeAll(): void; } declare var PNotify: PNotifyConstructor; + From 1c03e27739dd61f106082d276b6d252ad66d3443 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 27 Jan 2015 10:23:56 +0100 Subject: [PATCH 10/11] only one author possible --- jquery.pnotify/jquery.pnotify.d.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/jquery.pnotify/jquery.pnotify.d.ts b/jquery.pnotify/jquery.pnotify.d.ts index 13fd82d7a..6e3e67cd3 100644 --- a/jquery.pnotify/jquery.pnotify.d.ts +++ b/jquery.pnotify/jquery.pnotify.d.ts @@ -1,7 +1,6 @@ // Type definitions for jquery.pnotify 2.x // Project: https://github.com/sciactive/pnotify // Definitions by: David Sichau -// Definitions by: Louis Grignon // Definitions: https://github.com/borisyankov/DefinitelyTyped /// From d271513e241397c9e334d679a6c53d7c4d7b6fbd Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 27 Jan 2015 10:28:44 +0100 Subject: [PATCH 11/11] removed legacy def file --- jquery.pnotify/jquery.pnotify-1.x.d.ts | 173 ------------------------- 1 file changed, 173 deletions(-) delete mode 100644 jquery.pnotify/jquery.pnotify-1.x.d.ts diff --git a/jquery.pnotify/jquery.pnotify-1.x.d.ts b/jquery.pnotify/jquery.pnotify-1.x.d.ts deleted file mode 100644 index 73d0411d5..000000000 --- a/jquery.pnotify/jquery.pnotify-1.x.d.ts +++ /dev/null @@ -1,173 +0,0 @@ -// Type definitions for jquery.pnotify 1.3.1 -// Project: https://github.com/sciactive/pnotify -// Definitions by: David Sichau -// Definitions: https://github.com/borisyankov/DefinitelyTyped - - -/// - -interface pnotifyStack { - dir1?: string; - dir2?: string; - push?: string; - spacing1?: number; - spacing2?: number; - context?: JQuery -} - -interface pnotifyLabel { - redisplay?: string; - all?: string; - last?: string; - close?: string; - stick?: string; -} - -interface pnotifyDefaults { - /** - * The notice's title. Either boolean false or string - */ - title?: any; - /** - * Whether to escape the content of the title. (Not allow HTML.) - */ - title_escape?: boolean; - /** - * The notice's text. Either boolean false or string - */ - text?: any; - /** - * Whether to escape the content of the text. (Not allow HTML.) - */ - text_escape?: boolean; - /** - * What styling classes to use. (Can be either jqueryui or bootstrap.) - */ - styling?: string; - /** - * Additional classes to be added to the notice. (For custom styling.) - */ - addclass?: string; - /** - * Class to be added to the notice for corner styling. - */ - cornerclass?: string; - /** - * Create a non-blocking notice. It lets the user click elements underneath it. - */ - nonblock?: boolean; - /** - * The opacity of the notice (if it's non-blocking) when the mouse is over it. - */ - nonblock_opacity?: number; - /** - * Display a pull down menu to redisplay previous notices, and place the notice in the history. - */ - history?: boolean; - /** - * Maximum number of notifications to have onscreen. - */ - maxonscreen?: number; - /** - * Display the notice when it is created. Turn this off to add notifications to the history without displaying them. - */ - auto_display?: boolean; - /** - * Width of the notice. - */ - width?: string; - /** - * Minimum height of the notice. It will expand to fit content. - */ - min_height?: string; - /** - * Type of the notice. "notice", "info", "success", or "error". - */ - type?: string; - /** - * Set icon to true to use the default icon for the selected style/type, false for no icon, or a string for your own icon class. - */ - icon?: any; - /** - * The animation to use when displaying and hiding the notice. "none", "show", "fade", and "slide" are built in to jQuery. Others require jQuery UI. Use an object with effect_in and effect_out to use different effects. - */ - animation?: any; - /** - * Speed at which the notice animates in and out. "slow", "def" or "normal", "fast" or number of milliseconds. - */ - animate_speed?: string; - /** - * Specify a specific duration of position animation - */ - position_animate_speed?: number; - /** - * Opacity of the notice. - */ - opacity?: number; - /** - * Display a drop shadow. - */ - shadow?: boolean; - /** - * Provide a button for the user to manually close the notice. - */ - closer?: boolean; - /** - * Only show the closer button on hover. - */ - closer_hover?: boolean; - /** - * Provide a button for the user to manually stick the notice. - */ - sticker?: boolean; - /** - * Only show the sticker button on hover. - */ - sticker_hover?: boolean; - /** - * After a delay, remove the notice. - */ - hide?: boolean; - /** - * Delay in milliseconds before the notice is removed. - */ - delay?: number; - /** - * Reset the hide timer if the mouse moves over the notice. - */ - mouse_reset?: boolean; - /** - * Remove the notice's elements from the DOM after it is removed. - */ - remove?: boolean; - /** - * Change new lines to br tags. - */ - insert_brs?: boolean; - /** - * The stack on which the notices will be placed. Also controls the direction the notices stack. - */ - stack?: pnotifyStack; - /** - * The various displayed text, helps facilitating internationalization. - */ - labels?: pnotifyLabel; -} - - -interface pnotifyInterface { - defaults?: pnotifyDefaults - (options: pnotifyDefaults): any; -} - -interface JQueryStatic { - /** - * The pnotify object - */ - pnotify: pnotifyInterface; - /** - * Removes all notifications - */ - pnotify_remove_all(): void; -} -