"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "Upload/jscripts/jquery.plugins.js" between
mybb_1819.zip and mybb_1820.zip

About: MyBB is a multilingual, standards-compliant and free forum (discussion board) software.

jquery.plugins.js  (mybb_1819):jquery.plugins.js  (mybb_1820)
skipping to change at line 568 skipping to change at line 568
$.fn.popupMenu = function(close_in_popupmenu) $.fn.popupMenu = function(close_in_popupmenu)
{ {
return this.each(function() return this.each(function()
{ {
var popup = new PopupMenu(this, close_in_popupmenu); var popup = new PopupMenu(this, close_in_popupmenu);
$(this).click(popup.open); $(this).click(popup.open);
}); });
} }
})(jQuery); })(jQuery);
/*! jQuery-Impromptu - v6.2.3 - 2016-04-23
* http://trentrichardson.com/Impromptu
* Copyright (c) 2016 Trent Richardson; Licensed MIT */
(function(root, factory) {
if (typeof define === 'function' && define.amd) {
define(['jquery'], factory);
} else {
factory(root.jQuery);
}
}(this, function($) {
'use strict';
// ######################################################################
##
// Base object
// ######################################################################
##
/**
* Imp - Impromptu object - passing no params will not open, only return t
he instance
* @param message String/Object - String of html or Object of states
* @param options Object - Options to set the prompt
* @return Imp - the instance of this Impromptu object
*/
var Imp = function(message, options){
var t = this;
t.id = Imp.count++;
Imp.lifo.push(t);
if(message){
t.open(message, options);
}
return t;
};
// ######################################################################
##
// static properties and methods
// ######################################################################
##
/**
* defaults - the default options
*/
Imp.defaults = {
prefix:'jqi',
classes: {
box: '',
fade: '',
prompt: '',
form: '',
close: '',
title: '',
message: '',
buttons: '',
button: '',
defaultButton: ''
},
title: '',
closeText: '×',
buttons: {
Ok: true
},
buttonTimeout: 1000,
loaded: function(e){},
submit: function(e,v,m,f){},
close: function(e,v,m,f){},
statechanging: function(e, from, to){},
statechanged: function(e, to){},
opacity: 0.6,
zIndex: 999,
overlayspeed: 'slow',
promptspeed: 'fast',
show: 'fadeIn',
hide: 'fadeOut',
focus: 0,
defaultButton: 0,
useiframe: false,
top: '15%',
position: {
container: null,
x: null,
y: null,
arrow: null,
width: null
},
persistent: true,
timeout: 0,
states: {},
initialState: 0,
state: {
name: null,
title: '',
html: '',
buttons: {
Ok: true
},
focus: 0,
defaultButton: 0,
position: {
container: null,
x: null,
y: null,
arrow: null,
width: null
},
submit: function(e,v,m,f){
return true;
}
}
};
/**
* setDefaults - Sets the default options
* @param o Object - Options to set as defaults
* @return void
*/
Imp.setDefaults = function(o) {
Imp.defaults = $.extend({}, Imp.defaults, o);
};
/**
* setStateDefaults - Sets the default options for a state
* @param o Object - Options to set as defaults
* @return void
*/
Imp.setStateDefaults = function(o) {
Imp.defaults.state = $.extend({}, Imp.defaults.state, o);
};
/**
* @var Int - A counter used to provide a unique ID for new prompts
*/
Imp.count = 0;
/**
* @var Array - An array of Impromptu intances in a LIFO queue (last in fi
rst out)
*/
Imp.lifo = [];
/**
* getLast - get the last element from the queue (doesn't pop, just return
s)
* @return Imp - the instance of this Impromptu object or false if queue i
s empty
*/
Imp.getLast = function(){
var l = Imp.lifo.length;
return (l > 0)? Imp.lifo[l-1] : false;
};
/**
* removeFromStack - remove an element from the lifo stack by its id
* @param id int - id of the instance to remove
* @return api - The api of the element removed from the stack or void
*/
Imp.removeFromStack = function(id){
for(var i=Imp.lifo.length-1; i>=0; i--){
if(Imp.lifo[i].id === id){
return Imp.lifo.splice(i,1)[0];
}
}
};
// ######################################################################
##
// extend our object instance properties and methods
// ######################################################################
##
Imp.prototype = {
/**
* @var Int - A unique id, simply an autoincremented number
*/
id: null,
/**
* open - Opens the prompt
* @param message String/Object - String of html or Object of stat
es
* @param options Object - Options to set the prompt
* @return Imp - the instance of this Impromptu object
*/
open: function(message, options) {
var t = this;
t.options = $.extend({},Imp.defaults,options);
// Be sure any previous timeouts are destroyed
if(t.timeout){
clearTimeout(t.timeout);
}
t.timeout = false;
var opts = t.options,
$body = $(document.body),
$window = $(window);
//build the box and fade
var msgbox = '<div class="'+ opts.prefix +'box '+ opts.cl
asses.box +'">';
if(opts.useiframe && ($('object, applet').length > 0)) {
msgbox += '<iframe src="javascript:false;" class=
"'+ opts.prefix +'fade '+ opts.classes.fade +'"></iframe>';
} else {
msgbox += '<div class="'+ opts.prefix +'fade '+ o
pts.classes.fade +'"></div>';
}
msgbox += '<div class="'+ opts.prefix +' '+ opts.classes.
prompt +'">'+
'<form action="#" class="'+ opts.
prefix +'form '+ opts.classes.form +'">'+
'<div class="'+ opts.pref
ix +'close '+ opts.classes.close +'">'+ opts.closeText +'</div>'+
'<div class="'+ opts.pref
ix +'states"></div>'+
'</form>'+
'</div>'+
'</div>';
t.jqib = $(msgbox).appendTo($body);
t.jqi = t.jqib.children('.'+ opts.prefix);
t.jqif = t.jqib.children('.'+ opts.prefix +'fade');
//if a string was passed, convert to a single state
if(message.constructor === String){
message = {
state0: {
title: opts.title,
html: message,
buttons: opts.buttons,
position: opts.position,
focus: opts.focus,
defaultButton: opts.defaultButton
,
submit: opts.submit
}
};
}
//build the states
t.options.states = {};
var k,v;
for(k in message){
v = $.extend({},Imp.defaults.state,{name:k},messa
ge[k]);
t.addState(v.name, v);
if(t.currentStateName === ''){
t.currentStateName = v.name;
}
}
//Events
t.jqi.on('click', '.'+ opts.prefix +'buttons button', fun
ction(e){
var $t = $(this),
$state = $t.parents('.'+ opts.prefix +'st
ate'),
statename = $state.data('jqi-name'),
stateobj = t.options.states[statename],
msg = $state.children('.'+ opts.prefix +'
message'),
clicked = stateobj.buttons[$t.text()] ||
stateobj.buttons[$t.html()],
forminputs = {};
// disable for a moment to prevent multiple click
s
if(t.options.buttonTimeout > 0){
t.disableStateButtons(statename);
setTimeout(function(){
t.enableStateButtons(statename);
}, t.options.buttonTimeout);
}
// if for some reason we couldn't get the value
if(clicked === undefined){
for(var i in stateobj.buttons){
if(stateobj.buttons[i].title ===
$t.text() || stateobj.buttons[i].title === $t.html()){
clicked = stateobj.button
s[i].value;
}
}
}
//collect all form element values from all states
.
$.each(t.jqi.children('form').serializeArray(),fu
nction(i,obj){
if (forminputs[obj.name] === undefined) {
forminputs[obj.name] = obj.value;
} else if (typeof forminputs[obj.name] ==
= Array || typeof forminputs[obj.name] === 'object') {
forminputs[obj.name].push(obj.val
ue);
} else {
forminputs[obj.name] = [forminput
s[obj.name],obj.value];
}
});
// trigger an event
var promptsubmite = new $.Event('impromptu:submit
');
promptsubmite.stateName = stateobj.name;
promptsubmite.state = $state;
$state.trigger(promptsubmite, [clicked, msg, form
inputs]);
if(!promptsubmite.isDefaultPrevented()){
t.close(true, clicked,msg,forminputs);
}
});
// if the fade is clicked blink the prompt
var fadeClicked = function(){
if(opts.persistent){
var offset = (opts.top.toString().indexOf
('%') >= 0? ($window.height()*(parseInt(opts.top,10)/100)) : parseInt(opts.top,1
0)),
top = parseInt(t.jqi.css('top').r
eplace('px',''),10) - offset;
//$window.scrollTop(top);
$('html,body').animate({ scrollTop: top }
, 'fast', function(){
var i = 0;
t.jqib.addClass(opts.prefix +'war
ning');
var intervalid = setInterval(func
tion(){
t.jqib.toggleClass(opts.p
refix +'warning');
if(i++ > 1){
clearInterval(int
ervalid);
t.jqib.removeClas
s(opts.prefix +'warning');
}
}, 100);
});
}
else {
t.close(true);
}
};
// listen for esc or tab keys
var keyDownEventHandler = function(e){
var key = (window.event) ? event.keyCode : e.keyC
ode;
//escape key closes
if(key === 27) {
fadeClicked();
}
//enter key pressed trigger the default button if
its not on it, ignore if it is a textarea
if(key === 13){
var $defBtn = t.getCurrentState().find('.
'+ opts.prefix +'defaultbutton');
var $tgt = $(e.target);
if($tgt.is('textarea,.'+opts.prefix+'butt
on') === false && $defBtn.length > 0){
e.preventDefault();
$defBtn.click();
}
}
//constrain tabs, tabs should iterate through the
state and not leave
if (key === 9){
var $inputels = $('input,select,textarea,
button',t.getCurrentState());
var fwd = !e.shiftKey && e.target === $in
putels[$inputels.length-1];
var back = e.shiftKey && e.target === $in
putels[0];
if (fwd || back) {
setTimeout(function(){
if (!$inputels){
return;
}
var el = $inputels[back==
=true ? $inputels.length-1 : 0];
if (el){
el.focus();
}
},10);
return false;
}
}
};
t.position();
t.style();
// store copy of the window resize function for interal u
se only
t._windowResize = function(e){
t.position(e);
};
$window.resize({ animate: false }, t._windowResize);
t.jqif.click(fadeClicked);
t.jqi.find('.'+ opts.prefix +'close').click(function(){ t
.close(); });
t.jqi.find('.'+ opts.prefix +'form').submit(function(){ r
eturn false; });
t.jqib.on("keydown",keyDownEventHandler)
.on('impromptu:loaded', opts.load
ed)
.on('impromptu:close', opts.close
)
.on('impromptu:statechanging', op
ts.statechanging)
.on('impromptu:statechanged', opt
s.statechanged);
// Show it
t.jqif[opts.show](opts.overlayspeed);
t.jqi[opts.show](opts.promptspeed, function(){
t.goToState(
isNaN(opts.initialState) ? opts.initialSt
ate :
t.jqi.find('.'+ opts.prefix +'sta
tes .'+ opts.prefix +'state').eq(opts.initialState).data('jqi-name')
);
t.jqib.trigger('impromptu:loaded');
});
// Timeout
if(opts.timeout > 0){
t.timeout = setTimeout(function(){ t.close(true);
},opts.timeout);
}
return t;
},
/**
* close - Closes the prompt
* @param callback Function - called when the transition is comple
te
* @param clicked String - value of the button clicked (only used
internally)
* @param msg jQuery - The state message body (only used internall
y)
* @param forvals Object - key/value pairs of all form field names
and values (only used internally)
* @return Imp - the instance of this Impromptu object
*/
close: function(callCallback, clicked, msg, formvals){
var t = this;
Imp.removeFromStack(t.id);
if(t.timeout){
clearTimeout(t.timeout);
t.timeout = false;
}
if(t.jqib){
t.jqib[t.options.hide]('fast',function(){
t.jqib.trigger('impromptu:close', [clicke
d,msg,formvals]);
t.jqib.remove();
$(window).off('resize', t._windowResize);
if(typeof callCallback === 'function'){
callCallback();
}
});
}
t.currentStateName = "";
return t;
},
/**
* addState - Injects a state into the prompt
* @param statename String - Name of the state
* @param stateobj Object - options for the state
* @param afterState String - selector of the state to insert afte
r
* @return jQuery - the newly created state
*/
addState: function(statename, stateobj, afterState) {
var t = this,
state = '',
$state = null,
arrow = '',
title = '',
opts = t.options,
pos = $.isFunction(stateobj.position) ? stateobj.
position() : stateobj.position,
$jqistates = t.jqi.find('.'+ opts.prefix +'states
'),
buttons = [],
showHtml,defbtn,k,v,l,i=0;
stateobj = $.extend({},Imp.defaults.state, {name:statenam
e}, stateobj);
if($.isPlainObject(pos) && pos.arrow !== null){
arrow = '<div class="'+ opts.prefix + 'arrow '+ o
pts.prefix + 'arrow'+ pos.arrow +'"></div>';
}
if(stateobj.title && stateobj.title !== ''){
title = '<div class="lead '+ opts.prefix + 'title
'+ opts.classes.title +'">'+ stateobj.title +'</div>';
}
showHtml = stateobj.html;
if (typeof stateobj.html === 'function') {
showHtml = 'Error: html function must return text
';
}
state += '<div class="'+ opts.prefix + 'state" data-jqi-n
ame="'+ statename +'">'+
arrow + title +
'<div class="'+ opts.prefix +'mes
sage '+ opts.classes.message +'">' + showHtml +'</div>'+
'<div class="'+ opts.prefix +'but
tons'+ ($.isEmptyObject(stateobj.buttons)? 'hide ':' ') + opts.classes.buttons +
'">';
// state buttons may be in object or array, lets convert
objects to arrays
if($.isArray(stateobj.buttons)){
buttons = stateobj.buttons;
}
else if($.isPlainObject(stateobj.buttons)){
for(k in stateobj.buttons){
if(stateobj.buttons.hasOwnProperty(k)){
buttons.push({ title: k, value: s
tateobj.buttons[k] });
}
}
}
// iterate over each button and create them
for(i=0, l=buttons.length; i<l; i++){
v = buttons[i],
defbtn = stateobj.focus === i || (isNaN(stateobj.
focus) && stateobj.defaultButton === i) ? (opts.prefix + 'defaultbutton ' + opts
.classes.defaultButton) : '';
state += '<button class="'+ opts.classes.button +
' '+ opts.prefix + 'button '+ defbtn;
if(typeof v.classes !== "undefined"){
state += ' '+ ($.isArray(v.classes)? v.cl
asses.join(' ') : v.classes) + ' ';
}
state += '" name="' + opts.prefix + '_' + statena
me + '_button' + v.title.replace(/[^a-z0-9]+/gi,'') + '" value="' + v.value + '"
>' + v.title + '</button>';
}
state += '</div></div>';
$state = $(state).css({display:'none'});
$state.on('impromptu:submit', stateobj.submit);
if(afterState !== undefined){
t.getState(afterState).after($state);
}
else{
$jqistates.append($state);
}
t.options.states[statename] = stateobj;
return $state;
},
/**
* removeState - Removes a state from the prompt
* @param state String - Name of the state
* @param newState String - Name of the state to transition to
* @return Boolean - returns true on success, false on failure
*/
removeState: function(state, newState) {
var t = this,
$state = t.getState(state),
rm = function(){ $state.remove(); };
if($state.length === 0){
return false;
}
// transition away from it before deleting
if($state.css('display') !== 'none'){
if(newState !== undefined && t.getState(newState)
.length > 0){
t.goToState(newState, false, rm);
}
else if($state.next().length > 0){
t.nextState(rm);
}
else if($state.prev().length > 0){
t.prevState(rm);
}
else{
t.close();
}
}
else{
$state.slideUp('slow', rm);
}
return true;
},
/**
* getApi - Get the api, so you can extract it from $.prompt stack
* @return jQuery - the prompt
*/
getApi: function() {
return this;
},
/**
* getBox - Get the box containing fade and prompt
* @return jQuery - the prompt
*/
getBox: function() {
return this.jqib;
},
/**
* getPrompt - Get the prompt
* @return jQuery - the prompt
*/
getPrompt: function() {
return this.jqi;
},
/**
* getState - Get the state by its name
* @param statename String - Name of the state
* @return jQuery - the state
*/
getState: function(statename) {
return this.jqi.find('[data-jqi-name="'+ statename +'"]')
;
},
/**
* getCurrentState - Get the current visible state
* @return jQuery - the current visible state
*/
getCurrentState: function() {
return this.getState(this.getCurrentStateName());
},
/**
* getCurrentStateName - Get the name of the current visible state
/substate
* @return String - the current visible state's name
*/
getCurrentStateName: function() {
return this.currentStateName;
},
/**
* disableStateButtons - Disables the buttons in a state
* @param statename String - Name of the state containing buttons
* @param buttons Array - Array of button values to disable. By de
fault all are disabled
* @param enable Boolean - True to enable the buttons instead of d
isabling (internally use only)
* @return Void
*/
disableStateButtons: function(statename, buttons, enable) {
var t = this;
if($.isArray(statename)){
buttons = statename;
statename = null;
}
t.getState(statename || t.getCurrentStateName()).find('.'
+ t.options.prefix + 'button').each(function(i,btn){
if(buttons === undefined || $.inArray(btn.value,
buttons) !== -1){
btn.disabled = !enable;
}
});
},
/**
* enableStateButtons - Enables the buttons in a state
* @param statename String - Name of the state containing buttons.
Defaults to current state
* @param buttons Array - Array of button values to enable. By def
ault all are enabled
* @return Void
*/
enableStateButtons: function(statename, buttons) {
this.disableStateButtons(statename, buttons, true);
},
/**
* position - Repositions the prompt (Used internally)
* @return void
*/
position: function(e){
var t = this,
restoreFx = $.fx.off,
$state = t.getCurrentState(),
stateObj = t.options.states[$state.data('jqi-name
')],
pos = stateObj ? $.isFunction(stateObj.position)
? stateObj.position() : stateObj.position : undefined,
$window = $(window),
bodyHeight = document.body.scrollHeight, //$(docu
ment.body).outerHeight(true),
windowHeight = $(window).height(),
documentHeight = $(document).height(),
height = (bodyHeight > windowHeight) ? bodyHeight
: windowHeight,
scrollTop = parseInt($window.scrollTop(),10),
top = scrollTop + (t.options.top.toString().index
Of('%') >= 0?
(windowHeight*(parseInt(t.options
.top,10)/100)) : parseInt(t.options.top,10));
// when resizing the window turn off animation
if(e !== undefined && e.data.animate === false){
$.fx.off = true;
}
t.jqib.css({
position: "absolute",
height: height,
width: "100%",
top: 0,
left: 0,
right: 0,
bottom: 0
});
t.jqif.css({
position: "fixed",
height: height,
width: "100%",
top: 0,
left: 0,
right: 0,
bottom: 0
});
// tour positioning
if(pos && pos.container){
var offset = $(pos.container).offset(),
hasScrolled = false;
if($.isPlainObject(offset) && offset.top !== unde
fined){
top = (offset.top + pos.y) - (t.options.t
op.toString().indexOf('%') >= 0? (windowHeight*(parseInt(t.options.top,10)/100))
: parseInt(t.options.top,10));
t.jqi.css({
position: "absolute"
});
t.jqi.animate({
top: offset.top + pos.y,
left: offset.left + pos.x,
marginLeft: 0,
width: (pos.width !== undefined)?
pos.width : null
}, function(){
// if it didn't scroll before, ch
eck that the bottom is within view. Since width
// is animated we must use the ca
llback before we know the height
if(!hasScrolled && (offset.top +
pos.y + t.jqi.outerHeight(true)) > (scrollTop + windowHeight)){
$('html,body').animate({
scrollTop: top }, 'slow', 'swing', function(){});
hasScrolled = true;
}
});
// scroll if the top is out of the viewin
g area
if(top < scrollTop || top > scrollTop + w
indowHeight){
$('html,body').animate({ scrollTo
p: top }, 'slow', 'swing', function(){});
hasScrolled = true;
}
}
}
// custom state width animation
else if(pos && pos.width){
t.jqi.css({
position: "absolute",
left: '50%'
});
t.jqi.animate({
top: pos.y || top,
left: pos.x || '50%',
marginLeft: ((pos.width/2)*-1),
width: pos.width
});
}
// standard prompt positioning
else{
t.jqi.css({
position: "absolute",
top: top,
left: '50%',//$window.width()/2,
marginLeft: ((t.jqi.outerWidth(false)/2)*
-1)
});
}
// restore fx settings
if(e !== undefined && e.data.animate === false){
$.fx.off = restoreFx;
}
},
/**
* style - Restyles the prompt (Used internally)
* @return void
*/
style: function(){
var t = this;
t.jqif.css({
zIndex: t.options.zIndex,
display: "none",
opacity: t.options.opacity
});
t.jqi.css({
zIndex: t.options.zIndex+1,
display: "none"
});
t.jqib.css({
zIndex: t.options.zIndex
});
},
/**
* goToState - Goto the specified state
* @param state String - name of the state to transition to
* @param subState Boolean - true to be a sub state within the cur
rently open state
* @param callback Function - called when the transition is comple
te
* @return jQuery - the newly active state
*/
goToState: function(state, subState, callback) {
var t = this,
$jqi = t.jqi,
jqiopts = t.options,
$state = t.getState(state),
stateobj = jqiopts.states[$state.data('jqi-name')
],
promptstatechanginge = new $.Event('impromptu:sta
techanging'),
opts = t.options;
if(stateobj !== undefined){
if (typeof stateobj.html === 'function') {
var contentLaterFunc = stateobj.html;
$state.find('.' + opts.prefix +'message '
).html(contentLaterFunc());
}
// subState can be ommitted
if(typeof subState === 'function'){
callback = subState;
subState = false;
}
t.jqib.trigger(promptstatechanginge, [t.getCurren
tStateName(), state]);
if(!promptstatechanginge.isDefaultPrevented() &&
$state.length > 0){
t.jqi.find('.'+ opts.prefix +'parentstate
').removeClass(opts.prefix +'parentstate');
if(subState){ // hide any open substates
// get rid of any substates
t.jqi.find('.'+ opts.prefix +'sub
state').not($state)
.slideUp(jqiopts.promptsp
eed)
.removeClass('.'+ opts.pr
efix +'substate')
.find('.'+ opts.prefix +'
arrow').hide();
// add parent state class so it c
an be visible, but blocked
t.jqi.find('.'+ opts.prefix +'sta
te:visible').addClass(opts.prefix +'parentstate');
// add substate class so we know
it will be smaller
$state.addClass(opts.prefix +'sub
state');
}
else{ // hide any open states
t.jqi.find('.'+ opts.prefix +'sta
te').not($state)
.slideUp(jqiopts.promptsp
eed)
.find('.'+ opts.prefix +'
arrow').hide();
}
t.currentStateName = stateobj.name;
$state.slideDown(jqiopts.promptspeed,func
tion(){
var $t = $(this);
t.enableStateButtons();
// if focus is a selector, find i
t, else its button index
if(typeof(stateobj.focus) === 'st
ring'){
$t.find(stateobj.focus).e
q(0).focus();
}
else{
$t.find('.'+ opts.prefix
+'defaultbutton').focus();
}
$t.find('.'+ opts.prefix +'arrow'
).show(jqiopts.promptspeed);
if (typeof callback === 'function
'){
t.jqib.on('impromptu:stat
echanged', callback);
}
t.jqib.trigger('impromptu:statech
anged', [state]);
if (typeof callback === 'function
'){
t.jqib.off('impromptu:sta
techanged', callback);
}
});
if(!subState){
t.position();
}
} // end isDefaultPrevented()
}// end stateobj !== undefined
return $state;
},
/**
* nextState - Transition to the next state
* @param callback Function - called when the transition is comple
te
* @return jQuery - the newly active state
*/
nextState: function(callback) {
var t = this,
$next = t.getCurrentState().next();
if($next.length > 0){
t.goToState( $next.data('jqi-name'), callback );
}
return $next;
},
/**
* prevState - Transition to the previous state
* @param callback Function - called when the transition is comple
te
* @return jQuery - the newly active state
*/
prevState: function(callback) {
var t = this,
$prev = t.getCurrentState().prev();
if($prev.length > 0){
t.goToState( $prev.data('jqi-name'), callback );
}
return $prev;
}
};
// ######################################################################
##
// $.prompt will manage a queue of Impromptu instances
// ######################################################################
##
/**
* $.prompt create a new Impromptu instance and push it on the stack of in
stances
* @param message String/Object - String of html or Object of states
* @param options Object - Options to set the prompt
* @return jQuery - the jQuery object of the prompt within the modal
*/
$.prompt = function(message, options){
var api = new Imp(message, options);
return api.jqi;
};
/**
* Copy over static methods
*/
$.each(Imp, function(k,v){
$.prompt[k] = v;
});
/**
* Create a proxy for accessing all instance methods. The close method pop
s from queue.
*/
$.each(Imp.prototype, function(k,v){
$.prompt[k] = function(){
var api = Imp.getLast(); // always use the last instance
on the stack
if(api && typeof api[k] === "function"){
return api[k].apply(api, arguments);
}
};
});
// ######################################################################
##
// jQuery Plugin and public access
// ######################################################################
##
/**
* Enable using $('.selector').prompt({});
* This will grab the html within the prompt as the prompt message
*/
$.fn.prompt = function(options){
if(options === undefined){
options = {};
}
if(options.withDataAndEvents === undefined){
options.withDataAndEvents = false;
}
$.prompt($(this).clone(options.withDataAndEvents).html(),options)
;
};
/**
* Export it as Impromptu and $.prompt
* Can be used from here forth as new Impromptu(states, opts)
*/
window.Impromptu = Imp;
}));
/*! /*!
* JavaScript Cookie v2.1.4 * JavaScript Cookie v2.1.4
* https://github.com/js-cookie/js-cookie * https://github.com/js-cookie/js-cookie
* *
* Copyright 2006, 2015 Klaus Hartl & Fagner Brack * Copyright 2006, 2015 Klaus Hartl & Fagner Brack
* Released under the MIT license * Released under the MIT license
*/ */
;(function (factory) { ;(function (factory) {
var registeredInModuleLoader = false; var registeredInModuleLoader = false;
if (typeof define === 'function' && define.amd) { if (typeof define === 'function' && define.amd) {
 End of changes. 1 change blocks. 
1079 lines changed or deleted 0 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)