Changeset 1031
- Timestamp:
- 08/23/08 15:13:52 (3 months ago)
- Files:
-
- 3 modified
-
branches/new-dialogs/plugins/Stylist/stylist.js (modified) (1 diff)
-
trunk/examples/XinhaConfig.js (modified) (1 diff)
-
trunk/plugins/Stylist/stylist.js (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/new-dialogs/plugins/Stylist/stylist.js
r1008 r1031 453 453 Xinha.ripStylesFromCSSFile = function(URL) 454 454 { 455 Xinha.setLoadingMessage('Loading Styles');456 455 var css = Xinha._geturlcontent(URL); 456 var RE_atimport = '@import\\s*(url\\()?["\'](.*)["\'].*'; 457 var imports = css.match(new RegExp(RE_atimport,'ig')); 458 var m, file, re = new RegExp(RE_atimport,'i'); 459 460 if (imports) 461 { 462 var path = URL.replace(/\?.*$/,'').split("/"); 463 path.pop(); 464 path = path.join('/'); 465 for (var i=0;i<imports.length;i++) 466 { 467 m = imports[i].match(re); 468 file = m[2]; 469 if (!file.match(/^([^:]+\:)?\//)) 470 { 471 file = Xinha._resolveRelativeUrl(path,file); 472 } 473 css += Xinha._geturlcontent(file); 474 } 475 } 476 457 477 return Xinha.ripStylesFromCSSString(css); 458 478 }; -
trunk/examples/XinhaConfig.js
r1000 r1031 68 68 // NOTE : YOU MUST GIVE AN ABSOLUTE URL 69 69 70 xinha_config.pageStyleSheets = [ _editor_url + "examples/full_example.css" ]; 70 xinha_config.pageStyleSheets = [ _editor_url + "examples/files/full_example.css" ]; 71 //if you're using Stylist, import a stylesheet like this 72 xinha_config.stylistLoadStylesheet(_editor_url + "examples/files/stylist.css"); 71 73 72 74 /** STEP 4 *************************************************************** -
trunk/plugins/Stylist/stylist.js
r1000 r1031 453 453 { 454 454 var css = Xinha._geturlcontent(URL); 455 var RE_atimport = '@import\\s*(url\\()?["\'](.*)["\'].*'; 456 var imports = css.match(new RegExp(RE_atimport,'ig')); 457 var m, file, re = new RegExp(RE_atimport,'i'); 458 459 if (imports) 460 { 461 var path = URL.replace(/\?.*$/,'').split("/"); 462 path.pop(); 463 path = path.join('/'); 464 for (var i=0;i<imports.length;i++) 465 { 466 m = imports[i].match(re); 467 file = m[2]; 468 if (!file.match(/^([^:]+\:)?\//)) 469 { 470 file = Xinha._resolveRelativeUrl(path,file); 471 } 472 css += Xinha._geturlcontent(file); 473 } 474 } 475 455 476 return Xinha.ripStylesFromCSSString(css); 456 477 }; … … 462 483 RE_comment = /\/\*(.|\r|\n)*?\*\//g; 463 484 RE_rule = /\{(.|\r|\n)*?\}/g; 485 css = css.replace(RE_comment, ''); 464 486 css = css.replace(RE_comment, ''); 465 487 css = css.replace(RE_rule, ',');
