| Previous CloneSet | Next CloneSet | Back to Main Report |
| Clone Mass | Clones in CloneSet | Parameter Count | Clone Similarity | Syntax Category [Sequence Length] |
|---|---|---|---|---|
| 17 | 2 | 5 | 0.974 | SourceElements[2] |
| Clone Abstraction | Parameter Bindings |
| Clone Instance (Click to see clone) | Line Count | Source Line | Source File |
|---|---|---|---|
| 1 | 17 | 529 | Closure/closure/goog/i18n/bidi.js |
| 2 | 17 | 559 | Closure/closure/goog/i18n/bidi.js |
| ||||
/**
* Enforce the html snippet in RTL directionality regardless overall context.
* If the html piece was enclosed by tag, dir will be applied to existing
* tag, otherwise a span tag will be added as wrapper. For this reason, if
* html snippet start with with tag, this tag must enclose the whole piece. If
* the tag already has a dir specified, this new one will override existing
* one in behavior (tested on FF and IE).
* @param {string} html The string that need to be processed.
* @return {string} The processed string, with directionality enforced to RTL.
*/
goog.i18n.bidi.enforceRtlInHtml= function (html){
if (html.charAt(0)== '<') {
return html.replace(/<\w+/, '$& dir=rtl');
}
// '\n' is important for FF so that it won't incorrectly merge span groups
return '\n\x3cspan dir=rtl>'+html+ '</span>';
} ;
/**
* Enforce RTL on both end of the given text piece using unicode BiDi formatting
* characters RLE and PDF.
* @param {string} text The piece of text that need to be wrapped.
* @return {string} The wrapped string after process.
*/
goog.i18n.bidi.enforceRtlInText= function (text){
return goog.i18n.bidi.Format.RLE+ text+ goog.i18n.bidi.Format.PDF;
} ;
|
| ||||
/**
* Enforce the html snippet in RTL directionality regardless overall context.
* If the html piece was enclosed by tag, dir will be applied to existing
* tag, otherwise a span tag will be added as wrapper. For this reason, if
* html snippet start with with tag, this tag must enclose the whole piece. If
* the tag already has a dir specified, this new one will override existing
* one in behavior (tested on FF and IE).
* @param {string} html The string that need to be processed.
* @return {string} The processed string, with directionality enforced to RTL.
*/
goog.i18n.bidi.enforceLtrInHtml= function (html){
if (html.charAt(0)== '<') {
return html.replace(/<\w+/, '$& dir=ltr');
}
// '\n' is important for FF so that it won't incorrectly merge span groups
return '\n\x3cspan dir=ltr>'+html+ '</span>';
} ;
/**
* Enforce LTR on both end of the given text piece using unicode BiDi formatting
* characters LRE and PDF.
* @param {string} text The piece of text that need to be wrapped.
* @return {string} The wrapped string after process.
*/
goog.i18n.bidi.enforceLtrInText= function (text){
return goog.i18n.bidi.Format.LRE+ text+ goog.i18n.bidi.Format.PDF;
} ;
|
| |||
/**
* Enforce the html snippet in RTL directionality regardless overall context.
* If the html piece was enclosed by tag, dir will be applied to existing
* tag, otherwise a span tag will be added as wrapper. For this reason, if
* html snippet start with with tag, this tag must enclose the whole piece. If
* the tag already has a dir specified, this new one will override existing
* one in behavior (tested on FF and IE).
* @param {string} html The string that need to be processed.
* @return {string} The processed string, with directionality enforced to RTL.
*/
goog.i18n.bidi. [[#variable62b662e0]]= function (html)
{ if (html.charAt(0)=='<')
{ return html.replace(/<\w+/, [[#variable62a5dde0]]);
}
// '\n' is important for FF so that it won't incorrectly merge span groups
return [[#variable62b66140]]+html+'</span>';
} ;
/**
* Enforce RTL on both end of the given text piece using unicode BiDi formatting
* characters RLE and PDF.
* @param {string} text The piece of text that need to be wrapped.
* @return {string} The wrapped string after process.
*/
/**
* Enforce LTR on both end of the given text piece using unicode BiDi formatting
* characters LRE and PDF.
* @param {string} text The piece of text that need to be wrapped.
* @return {string} The wrapped string after process.
*/
goog.i18n.bidi. [[#variable5ce758a0]]= function (text)
{ return goog.i18n.bidi.Format. [[#variable62b662a0]]+text+goog.i18n.bidi.Format.PDF;
} ;
|
| CloneAbstraction |
| Parameter Index | Clone Instance | Parameter Name | Value |
|---|---|---|---|
| 1 | 1 | [[#62b662e0]] | enforceRtlInHtml |
| 1 | 2 | [[#62b662e0]] | enforceLtrInHtml |
| 2 | 1 | [[#62a5dde0]] | '$& dir=rtl' |
| 2 | 2 | [[#62a5dde0]] | '$& dir=ltr' |
| 3 | 1 | [[#62b66140]] | '\n\x3cspan dir=rtl>' |
| 3 | 2 | [[#62b66140]] | '\n\x3cspan dir=ltr>' |
| 4 | 1 | [[#5ce758a0]] | enforceRtlInText |
| 4 | 2 | [[#5ce758a0]] | enforceLtrInText |
| 5 | 1 | [[#62b662a0]] | RLE |
| 5 | 2 | [[#62b662a0]] | LRE |