Changeset 1296
- Timestamp:
- 11/24/10 20:48:25 (2 years ago)
- Files:
-
- 1 modified
-
trunk/XinhaCore.js (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/XinhaCore.js
r1294 r1296 1059 1059 "Formatted": "pre" 1060 1060 }; 1061 1061 1062 /** You can provide custom functions that will be used to determine which of the 1063 * "formatblock" options is currently active and selected in the dropdown. 1064 * 1065 * Example: 1066 * <pre> 1067 * xinha_config.formatblockDetector['h5'] = function(xinha, currentElement) 1068 * { 1069 * if (my_special_matching_logic(currentElement)) { 1070 * return true; 1071 * } else { 1072 * return false; 1073 * } 1074 * }; 1075 * </pre> 1076 * 1077 * You probably don't want to mess with this, unless you are adding new, custom 1078 * "formatblock" options which don't correspond to real HTML tags. If you want 1079 * to do that, you can use this configuration option to tell xinha how to detect 1080 * when it is within your custom context. 1081 * 1082 * For more, see: http://www.coactivate.org/projects/xinha/custom-formatblock-options 1083 */ 1084 this.formatblockDetector = {}; 1085 1062 1086 this.dialogOptions = 1063 { 1087 { 1064 1088 'centered' : true, //true: dialog is shown in the center the screen, false dialog is shown near the clicked toolbar button 1065 1089 'greyout':true, //true: when showing modal dialogs, the page behind the dialoge is greyed-out … … 4902 4926 for ( var indexBlock in this.config.formatblock ) 4903 4927 { 4928 var blockname = this.config.formatblock[indexBlock]; 4904 4929 // prevent iterating over wrong type 4905 if ( typeof this.config.formatblock[indexBlock]== 'string' )4930 if ( typeof blockname == 'string' ) 4906 4931 { 4907 blocks[blocks.length] = this.config.formatblock [indexBlock];4932 blocks[blocks.length] = this.config.formatblockDetector[blockname] || blockname; 4908 4933 } 4909 4934 } … … 4911 4936 var match = this._getFirstAncestorAndWhy(this.getSelection(), blocks); 4912 4937 var deepestAncestor = match[0]; 4913 var matchIndex = match[1]; 4938 var matchIndex = match[1]; 4914 4939 4915 4940
