1$.widget('pretius.notifications', { 2 stackNotifications: [], 3 stackEmbeded: [], 4 options: { 5 successMessageTemplate: null, 6 notificationMessageTemplate: null 7 }, 8 _create: function ( ) { 9 this._super( this.options ); 10 }, 11 _getTrimedSuccessTemplate: function( ){ 12 var 13 returnValue = $(this.options.successMessageTemplate).clone().children().first(), 14 returnValueHtml = returnValue.parent().html(); 15 16 returnValueHtml = returnValueHtml.replace('#SUCCESS_MESSAGE#', '<div class="pretius--htmlMessage">#SUCCESS_MESSAGE#</div>'); 17 returnValueHtml = returnValueHtml.replace('#MESSAGE#' , '<div class="pretius--htmlMessage">#MESSAGE#</div>'); 18 19 returnValue = $(returnValueHtml).removeAttr('id').uniqueId().addClass('pretius--notification');; 20 21 return returnValue; 22 }, 23 _getTrimedMessageTemplate: function( ){ 24 25 var 26 returnValue = returnValue = $(this.options.notificationMessageTemplate).clone().children().first(); 27 returnValueHtml = returnValue.parent().html(); 28 29 returnValueHtml = returnValueHtml.replace('#SUCCESS_MESSAGE#', '<div class="pretius--htmlMessage">#SUCCESS_MESSAGE#</div>'); 30 returnValueHtml = returnValueHtml.replace('#MESSAGE#' , '<div class="pretius--htmlMessage">#MESSAGE#</div>'); 31 32 returnValue = $(returnValueHtml).removeAttr('id').uniqueId().addClass('pretius--embeded'); 33 34 return returnValue; 35 }, 36 37 destroy: function() { 38 $.Widget.prototype.destroy.call(this); 39 }, 40 41 pushNotification: function( pNotificationObject, daObject ){ 42 var pushedNotification = null; 43 44 var notification = $('<div></div>').notification( pNotificationObject, {manager: this, dynamicAction: daObject} ); 45 46 notification.notification('draw'); 47 48 49 }, 50 getTemplate: function( what ){ 51 if ( what == 'NOTIFICATION' ) { 52 return this._getTrimedSuccessTemplate(); 53 } 54 else if ( what == 'EMBEDED' ) { 55 return this._getTrimedMessageTemplate(); 56 } 57 else { 58 return null; 59 } 60 61 62 }, 63 throwError: function( errorTitle, errorMsg ){ 64 var notification = $('<div></div>').notification( { 65 manager: this, 66 dynamicAction: null, 67 closeAnimation: "REMOVE", 68 displayAs: "NOTIFICATION", 69 duration: "0", 70 insertInto: "body", 71 type: "DANGER", 72 where: "TOP", 73 msgType : 'JSJSON', 74 msgStaticText : null, 75 msgJsReturn : 'return data;', 76 position: 'TOPRIGHT', 77 merge: false, 78 scrollTo: false, 79 dynamicAction: {data: { 80 msg: errorTitle, 81 lines: [ errorMsg ] 82 }} 83 }); 84 85 notification.notification('draw'); 86 throw( errorMsg ); 87 } 88});
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.