comparison default/node_modules/shoestring/src/util/errors.js @ 0:1d038bc9b3d2 default tip

Up:default
author Liny <dev@neowd.com>
date Sat, 31 May 2025 09:21:51 +0800
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:1d038bc9b3d2
1 //>>excludeStart("exclude", pragmas.exclude);
2 define([ "shoestring" ], function(){
3 //>>excludeEnd("exclude");
4
5 shoestring.enUS = {
6 errors: {
7 "prefix": "Shoestring does not support",
8
9 "ajax-url-query": "data with urls that have existing query params",
10 "children-selector" : "passing selectors into .child, try .children().filter( selector )",
11 "click": "the click method. Try using .on( 'click', function(){}) or .trigger( 'click' ) instead.",
12 "css-get" : "getting computed attributes from the DOM.",
13 "data-attr-alias": "the data method aliased to `data-` DOM attributes.",
14 "each-length": "objects without a length passed into each",
15 "has-class" : "the hasClass method. Try using .is( '.klassname' ) instead.",
16 "html-function" : "passing a function into .html. Try generating the html you're passing in an outside function",
17 "index-shoestring-object": "an index call with a shoestring object argument. Use .get(0) on the argument instead.",
18 "live-delegate" : "the .live or .delegate methods. Use .bind or .on instead.",
19 "map": "the map method. Try using .each to make a new object.",
20 "next-selector" : "passing selectors into .next, try .next().filter( selector )",
21 "off-delegate" : ".off( events, selector, handler ) or .off( events, selector ). Use .off( eventName, callback ) instead.",
22 "next-until" : "the .nextUntil method. Use .next in a loop until you reach the selector, don't include the selector",
23 "on-delegate" : "the .on method with three or more arguments. Using .on( eventName, callback ) instead.",
24 "outer-width": "the outerWidth method. Try combining .width() with .css for padding-left, padding-right, and the border of the left and right side.",
25 "prev-selector" : "passing selectors into .prev, try .prev().filter( selector )",
26 "prevall-selector" : "passing selectors into .prevAll, try .prevAll().filter( selector )",
27 "queryselector": "all CSS selectors on querySelector (varies per browser support). Specifically, this failed: ",
28 "siblings-selector": "passing selector into siblings not supported, try .siblings().find( ... )",
29 "show-hide": "the show or hide methods. Use display: block (or whatever you'd like it to be) or none instead",
30 "text-setter": "setting text via the .text method.",
31 "toggle-class" : "the toggleClass method. Try using addClass or removeClass instead.",
32 "trim": "the trim method. Use String.prototype.trim."
33 }
34 };
35
36 shoestring.error = function( id, str ) {
37 var errors = shoestring.enUS.errors;
38 throw new Error( errors.prefix + " " + errors[id] + ( str ? " " + str : "" ) );
39 };
40
41 //>>excludeStart("exclude", pragmas.exclude);
42 });
43 //>>excludeEnd("exclude");