Changeset 2812
- Timestamp:
- 07/18/08 18:30:37 (1 month ago)
- Files:
-
- branches/release-41/lib/MT/CMS/Dashboard.pm (modified) (1 diff)
- branches/release-41/mt-static/js/tc/mixer/display.js (modified) (3 diffs)
- branches/release-41/mt-static/plugins/StyleCatcher/templates.css (modified) (1 diff)
- branches/release-41/mt-static/themes/hills-dusk/screen.css (modified) (1 diff)
- branches/release-41/plugins/StyleCatcher/lib/StyleCatcher/CMS.pm (modified) (14 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/release-41/lib/MT/CMS/Dashboard.pm
r2307 r2812 79 79 { 80 80 feature_label => MT->translate('Better, Stronger, Faster'), 81 feature_url => $app->help_url('mt4 15/known-issues.html'),82 feature_description => MT->translate(' A concerted effort has been made to make significant improvements to Movable Type\'s performance and reliability with added features like Server Side Includes and Template Module Caching.'),81 feature_url => $app->help_url('mt42/performance.html'), 82 feature_description => MT->translate('Movable Type has undergone a significant overhaul in all aspects of performance. Memory utilization has been reduced, publishing times have been increased significantly and search is now 100x faster!'), 83 83 }, 84 84 { 85 feature_label => MT->translate('Improved Template Management'), 86 feature_url => $app->help_url('mt415/whats-new.html#design-changes'), 87 feature_description => MT->translate('The template editing interface has been enhanced to make designers more efficient at updating their site\'s design.'), 85 feature_label => MT->translate('Module Caching'), 86 feature_url => $app->help_url('mt42/module-caching.html'), 87 feature_description => MT->translate('Template module and widget content can now be cached in the database to dramatically speed up publishing.'), 88 }, 89 { 90 feature_label => MT->translate('Improved Template and Design Management'), 91 feature_url => $app->help_url('mt42/design-enhancements.html'), 92 feature_description => MT->translate('The template editing interface has been enhanced to make designers more efficient at updating their site\'s design. The default templates have also been dramatically simplified to make it easier for you to edit and create the site you want.'), 88 93 }, 89 94 { 90 95 feature_label => MT->translate('Threaded Comments'), 91 feature_url => $app->help_url('mt4 15/threaded-comments.html'),96 feature_url => $app->help_url('mt42/threading.html'), 92 97 feature_description => MT->translate('Allow commenters on your blog to reply to each other increasing user engagement and creating more dynamic conversations.'), 93 98 }; branches/release-41/mt-static/js/tc/mixer/display.js
r1174 r2812 53 53 "description" : "Description:", 54 54 "author" : "Author:", 55 "tags" : "Tags:" 56 ,"url" : "URL:" 55 "tags" : "Tags:", 56 "url" : "CSS File", 57 "props_url" : "Donate" 57 58 }; 58 59 … … 227 228 // get natural language label 228 229 var epLabel = this.entryProperties[ ep ]; 229 var epValue = entry[ ep ] || " "; 230 var epValue = entry[ ep ]; 231 232 if( epValue == null ) 233 continue; 230 234 231 235 // fix array values 232 236 if( epValue.join ) 233 epValue = epValue.join( ", " );237 epValue = epValue.join( ", " ); 234 238 235 239 // only handle strings 236 240 if( typeof( epValue ) != "string" ) 237 continue;241 continue; 238 242 239 243 // property … … 242 246 props.appendChild( prop ); 243 247 244 // label245 var label = this.document.createElement( "span" );246 label.className = "label";247 label.appendChild( this.document.createTextNode( epLabel ) );248 prop.appendChild( label );249 250 248 // content 251 249 var content = this.document.createElement( "span" ); 252 250 content.className = "content"; 253 if ( ep Label == "URL:") {251 if ( ep.match(/(_|^)url$/) ) { 254 252 var link = this.document.createElement( "a" ); 255 253 link.href = epValue; 256 link.appendChild( this.document.createTextNode( "CSS File" )); 254 var link_text = this.document.createElement( "span" ); 255 link_text.appendChild( this.document.createTextNode( epLabel ) ); 256 link.appendChild( link_text ); 257 257 content.appendChild( link ); 258 258 } else { 259 content.appendChild( this.document.createTextNode( epValue ) ); 259 // label 260 var label = this.document.createElement( "span" ); 261 label.className = "label"; 262 label.appendChild( this.document.createTextNode( epLabel ) ); 263 prop.appendChild( label ); 264 content.appendChild( this.document.createTextNode( epValue ) ); 260 265 } 261 266 prop.appendChild( content ); branches/release-41/mt-static/plugins/StyleCatcher/templates.css
r1104 r2812 372 372 #display-details .url .content { display: inline; height: auto; } 373 373 374 #display-details .props_url { margin-bottom: 4px; } 375 #display-details .props_url .content { display: block; height: auto; } 376 #display-details .props_url .content a { 377 display: block; 378 background-image: url(https://www.paypal.com/en_US/i/btn/btn_donate_SM.gif); 379 width: 74px; 380 height: 21px; 381 } 382 #display-details .props_url .content a * { display: none } 383 374 384 /*#display-details .tags .label { display: inline; height: auto; } 375 385 #display-details .tags .content { display: inline; height: auto; word-spacing: 0.5em; }*/ branches/release-41/mt-static/themes/hills-dusk/screen.css
r1262 r2812 5 5 designer: Mena Trott 6 6 layouts: layout-wtt, layout-twt, layout-wt, layout-tw 7 props_url: byrne@majordojo.com 7 8 */ 8 9 branches/release-41/plugins/StyleCatcher/lib/StyleCatcher/CMS.pm
r2743 r2812 9 9 use strict; 10 10 use File::Basename qw(basename); 11 use MT::Util qw( caturl ); 11 12 12 13 our $DEFAULT_STYLE_LIBRARY; … … 155 156 $app->validate_magic or return $app->json_error($app->translate("Invalid request")); 156 157 return $app->json_error($app->translate("Invalid request")) 157 unless $blog_id && $url && $tmpl;158 unless $blog_id && $url && $tmpl; 158 159 159 160 my $static_path = $app->static_file_path; … … 162 163 } 163 164 164 my $themeroot = 165 File::Spec->catdir( $static_path, 'support', 'themes' ); 165 my $themeroot = File::Spec->catdir( $static_path, 'support', 'themes' ); 166 166 my $webthemeroot = $app->static_path . 'support/themes/'; 167 167 my $mtthemeroot = $app->static_path . 'themes/'; … … 174 174 # yonder... 175 175 my $filemgr = file_mgr() 176 or return $app->json_error( MT::FileMgr->errstr ); 176 or return $app->json_error( MT::FileMgr->errstr ); 177 print STDERR "Applying theme... ($url)\n"; 177 178 178 179 if ( $url !~ m/^(\Q$webthemeroot\E|\Q$mtthemeroot\E)/ ) { 179 180 my $new_url = ''; 180 181 181 for (0..(scalar(@url)-2)) { 182 182 $new_url .= $url[$_] . '/'; 183 183 } 184 print STDERR "Processing for application: $url\n"; 184 185 my ( $basename, $extension ) = split( /\./, $url[-1] ); 185 186 if ($basename eq 'screen') { … … 206 207 $content =~ s!/\*.*?\*/!!gs; # strip all comments first 207 208 my @images = $content =~ 208 m/\b(?:url\(\s*)([a-zA-Z0-9_.-]+\.(?:gif|jpe?g|png ))(?:\s*?\))/gi;209 m/\b(?:url\(\s*)([a-zA-Z0-9_.-]+\.(?:gif|jpe?g|png|css))(?:\s*?\))/gi; 209 210 $filemgr->mkpath( File::Spec->catdir( $themeroot, $basename ) ) 210 211 or return $app->json_error( … … 233 234 } 234 235 235 # Pick up the images we parsed earlier and write them to the theme folder236 # Pick up the images we parsed earlier and write them to the theme folder 236 237 for my $image_url (@images) { 237 238 my $image_request = … … 253 254 $url = "$webthemeroot$basename/$basename.css"; 254 255 } 256 print STDERR "url: $url\n"; 255 257 256 258 my $blog = MT->model('blog')->load($blog_id) … … 267 269 my $footer = '/* end StyleCatcher imports */'; 268 270 my $styles = $header . "\n"; 269 $styles .= "\@import url(". File::Spec->catfile($app->static_path, $base_css).");\n" if $base_css;271 $styles .= "\@import url(".caturl($app->static_path, $base_css).");\n" if $base_css; 270 272 $styles .= "\@import url($url);\n"; 271 273 $styles .= $footer; 272 print STDERR "styles=$styles\n";273 274 274 275 if ($template_text =~ s/\Q$header\E.*\Q$footer\E/$styles/s) { … … 426 427 my $data = {}; 427 428 428 # If we have a url then we're specifying a specific theme (css) or repo (html)429 # If we have a url then we're specifying a specific theme (css) or repo (html) 429 430 # Pick up the file (html with <link>s or a css file with metadata) 430 431 my $user_agent = $app->new_ua; … … 593 594 return unless $stylesheet; 594 595 595 # Break up the css url in to a couple useful pieces (generalize and break me out)596 # Break up the css url in to a couple useful pieces (generalize and break me out) 596 597 $theme = $url; 597 598 # discard any generic 'screen.css' filename … … 602 603 $new_url .= $url[$_] . '/'; 603 604 } 605 # note: this stripped off the css file and left a path only 604 606 } 605 607 else { … … 651 653 # Trim me white space, yarr 652 654 for (@comments) { 653 654 655 # TBD: strip any "risky" content; we don't want any 655 656 # XSS in this content. … … 663 664 } 664 665 666 # for my $line (@comments) { 667 # # TBD: strip any "risky" content; we don't want any 668 # # XSS in this content. 669 # # Strip any null bytes 670 # $line =~ tr/\x00//d; 671 # $line =~ s/^\s+|\s+$//g; 672 # if ($line =~ m{ \A (\w+) : \s* (.*) \z }xmsg) { 673 # my ( $key, $value ) = ($1, $2); 674 # print STDERR "$key => $value\n";# if (lc $key eq 'theme name' || lc $key eq 'name'); 675 # next if !$value; 676 # $metadata{ lc $key } = $value; 677 # } 678 # } 679 665 680 my $thumbnail_link; 666 681 $thumbnail_link = $new_url . 'thumbnail.gif'; … … 669 684 670 685 require MT::Util; 686 my $name = delete $metadata{'name'} || delete $metadata{'theme name'}; 687 print STDERR "name = $name\n"; 671 688 my $data = { 672 name => $theme, 673 description => $metadata{description} || '', 674 title => $metadata{name} || '(Untitled)', 689 # name => $theme, 690 name => $name, 691 # description => $metadata{'description'} || $metadata{'description'} || '', 692 title => $name || '(Untitled)', 675 693 url => $url, 676 694 imageSmall => $thumbnail_link, 677 695 imageBig => $thumbnail_large_link, 678 author => $metadata{designer} || $metadata{author} || '',679 author_url => $metadata{designer_url} || $metadata{author_url} || '',680 author_affiliation => $metadata{author_affiliation} || '',681 layouts => $metadata{layouts} || '',682 'sort' => $ metadata{name}|| '',696 author => delete $metadata{'designer'} || delete $metadata{'author'} || '', 697 author_url => delete $metadata{'designer_url'} || delete $metadata{'author_url'} || delete $metadata{'author uri'} || '', 698 # author_affiliation => $metadata{'author_affiliation'} || '', 699 # layouts => $metadata{'layouts'} || '', 700 'sort' => $name || '', 683 701 tags => $tags, 684 702 blogs => [], 685 703 }; 704 for my $field (qw( author_affiliation layouts description )) { 705 $data->{$field} = delete $metadata{$field} || ''; 706 } 707 # Toss in all the other metadata too. 708 @$data{keys %metadata} = values %metadata; 709 require Data::Dumper; 710 MT->log('YAY THEME DATA: ' . Data::Dumper::Dumper($data)); 686 711 $data; 687 712 }
