- Timestamp:
- Sep 15, 2014 9:44:27 PM (10 years ago)
- Location:
- trunk/js
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/js/Msg.js
r496 r497 18 18 */ 19 19 20 // All Codebase functions will be under the Strangecode namespace.20 // Codebase functions will be under the Strangecode namespace, unless they are added to the jQuery object for chaining. 21 21 var Strangecode = Strangecode || {}; 22 22 … … 38 38 var sc_msg = new Strangecode.Msg({ 39 39 container: '#sc-msg-formvalidator', 40 above_msg: 'The following errors occur ed:'40 above_msg: 'The following errors occurred:' 41 41 }); 42 42 sc_msg.raise('Oops, you fuxt up!', 'sc-msg-error'); -
trunk/js/Utilities.js
r496 r497 18 18 */ 19 19 20 // All Codebase functions will be under the Strangecode namespace.20 // Codebase functions will be under the Strangecode namespace, unless they are added to the jQuery object for chaining. 21 21 var Strangecode = Strangecode || {}; 22 22 … … 68 68 }); 69 69 }; 70 71 /* 72 * Encode HTML by proxying content via an in-memory div, setting its inner text which jQuery automatically encodes. 73 Then we pull the encoded contents back out. The div never exists on the page. 74 --------------------------------------------------------------------- 75 $('select').append($('<option>', { 76 value: value, 77 text: htmlEncode(text) 78 })); 79 --------------------------------------------------------------------- 80 * 81 * @access public 82 * @version 1.0 83 * @since 30 Jun 2013 84 */ 85 Strangecode.htmlEncode = function(text) { 86 return $('<div/>').text(text).html(); 87 }; 88 jQuery.fn.htmlEncode = Strangecode.htmlEncode;
Note: See TracChangeset
for help on using the changeset viewer.