1var semanticRatingBinding = new Shiny.InputBinding(); 2$.extend(semanticRatingBinding, { 3 find: function(scope) { 4 return $(scope).find(".ui.rating"); 5 }, 6 initialize: function(el){ 7 $("#" + el.id).rating('setting', 'clearable', true); 8 }, 9 getValue: function(el) { 10 return $(el).rating('get rating') || 0; 11 }, 12 subscribe: function(el, callback) { 13 $(el).rating('setting', 'onRate', function() { 14 callback(); 15 }); 16 }, 17 receiveMessage: function(el, data) { 18 var $el = $(el); 19 if (data.hasOwnProperty('label')) { 20 $('label[for="' + el.id + '"]').html(data.label); 21 } 22 if (data.hasOwnProperty('value')) { 23 $(el).rating('set rating', data.value); 24 } 25 }, 26 unsubscribe: function(el) { 27 $(el).off(); 28 } 29}); 30Shiny.inputBindings.register(semanticRatingBinding, 'shiny.semanticRating');
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.