From b7c4d2fdf61c933c9fc3fac47782971b4efd6aa2 Mon Sep 17 00:00:00 2001 From: rezeusor Date: Sat, 26 Nov 2011 01:04:59 -0500 Subject: [PATCH 1/7] Added NEW JQueryUI Autocomplete/Multicomplete plugin --- .../jquery.jeditable.ui-autocomplete.htm | 35 +++++++++++++++++++ .../jquery.jeditable.ui-autocomplete.js | 21 +++++++++++ 2 files changed, 56 insertions(+) create mode 100644 contributed/jquery.jeditable.ui-autocomplete.htm create mode 100644 contributed/jquery.jeditable.ui-autocomplete.js diff --git a/contributed/jquery.jeditable.ui-autocomplete.htm b/contributed/jquery.jeditable.ui-autocomplete.htm new file mode 100644 index 0000000..91670e9 --- /dev/null +++ b/contributed/jquery.jeditable.ui-autocomplete.htm @@ -0,0 +1,35 @@ +/* Autocomplete using jQueryUI1.8.16 [from rezeusor with love]*/ +/* This additional code needs to be inserted in your page for the multicomplete to work smoothly */ + + +function split( val ) { + return val.split( /,\s*/ ); +} +function extractLast( term ) { + return split( term ).pop(); +} +var listofstuff = ["0118","999","88199","9119","725","3"] ; +$('.importantNumbers').editable(function(value,settings){return save(this.id,value,this.revert);}, + {type:"autocomplete",autocomplete:{ + minLength: 0, + source: function( request, response ) { + response( $.ui.autocomplete.filter( analysts, extractLast( request.term ) ) ); + }, + focus: function() { + return false; + }, + select: function( event, ui ) { + var terms = split( this.value ); + terms.pop(); + terms.push( ui.item.value ); + terms.push( "" ); + // Set this to whatever you want to be + this.value = terms.join( ", " ); + return false; + } + }, + submit:'save', + cancel:'cancel', + onblur:'ignore' + } +); diff --git a/contributed/jquery.jeditable.ui-autocomplete.js b/contributed/jquery.jeditable.ui-autocomplete.js new file mode 100644 index 0000000..62111c4 --- /dev/null +++ b/contributed/jquery.jeditable.ui-autocomplete.js @@ -0,0 +1,21 @@ +/* Autocomplete using jQueryUI1.8.16 [from rezeusor with love] */ + +//Normal Autocomplete +$.editable.addInputType('autocomplete', { + element : $.editable.types.text.element, + plugin : function(settings, original) { + $('input', this).autocomplete(settings.autocomplete); + } +}); + +//Multiple Results Autocomplete +$.editable.addInputType('multicomplete', { + element : $.editable.types.text.element, + plugin : function(settings, original) { + $('input', this).bind( "keydown", function( event ) { + if ( event.keyCode === $.ui.keyCode.TAB && $( this ).data( "autocomplete" ).menu.active ) { + event.preventDefault(); + } + }).autocomplete(settings.autocomplete); + } +}); From 9c9d48265bd31d3f981dc46ac341d50ffff98bfc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20W=C3=B6rner?= Date: Mon, 28 May 2012 20:30:13 +0200 Subject: [PATCH 2/7] added wysihtml5 plugin added get_data function for plugins --- contributed/jquery.jeditable.wysihtml5.js | 44 +++++++ jquery.jeditable.js | 151 +++++++++++----------- 2 files changed, 122 insertions(+), 73 deletions(-) create mode 100644 contributed/jquery.jeditable.wysihtml5.js diff --git a/contributed/jquery.jeditable.wysihtml5.js b/contributed/jquery.jeditable.wysihtml5.js new file mode 100644 index 0000000..1e935e2 --- /dev/null +++ b/contributed/jquery.jeditable.wysihtml5.js @@ -0,0 +1,44 @@ +$.editable.addInputType('wysihtml5', { + element : function(settings, original) { + settings.wysihtml5 = new Array(); + settings.wysihtml5.editor = null; + settings.wysihtml5.uuid = Math.uuid(); + + var container = $('
'); + $(container).attr('id', settings.wysihtml5.uuid); + $(container).attr('class', 'wysihtml5'); + $(this).append(container); + + var toolbar = $('#wysihtml5-toolbar').clone(); + $(toolbar).attr('id', settings.wysihtml5.uuid + '-toolbar'); + $(toolbar).attr('class', 'wysihtml5-toolbar'); + $(container).append(toolbar); + + var textarea = $('