Changeset 817

Show
Ignore:
Timestamp:
07/09/08 20:20:27 (17 months ago)
Author:
breese
Message:

bringing the version of StyleCatcher? in the mtplugins repos up to date with what (will) ships with Movable Type 4.2

Location:
trunk/StyleCatcher
Files:
5 added
6 modified

Legend:

Unmodified
Added
Removed
  • trunk/StyleCatcher/mt-static/plugins/StyleCatcher/templates.css

    r7 r817  
    11td, input 
    22{ 
    3         font-family: verdana, "lucida grande", geneva, arial, helvetica, sans-serif; 
    4         font-size: 11px; 
    5         font-weight: normal; 
     3    font-family: verdana, "lucida grande", geneva, arial, helvetica, sans-serif; 
     4    font-size: 11px; 
     5    font-weight: normal; 
    66} 
    77hr 
    88{ 
    9         display: block; 
    10         line-height: 0; 
    11         height: 1px; 
    12         margin: 4px 0; 
    13         border: 0; 
    14         border-bottom: 1px #ccc solid; 
    15         padding: 0; 
     9    display: block; 
     10    line-height: 0; 
     11    height: 1px; 
     12    margin: 4px 0; 
     13    border: 0; 
     14    border-bottom: 1px #ccc solid; 
     15    padding: 0; 
    1616} 
    1717 
    1818img 
    1919{ 
    20         border: 0; 
     20    border: 0; 
    2121} 
    2222 
    2323.anchored 
    2424{ 
    25         position: relative; 
    26         top: 0; 
    27         left: 0; 
    28         width: 100%; 
     25    position: relative; 
     26    top: 0; 
     27    left: 0; 
     28    width: 100%; 
    2929} 
    3030 
    3131.left 
    3232{ 
    33         float: left; 
     33    float: left; 
    3434} 
    3535 
    3636.right 
    3737{ 
    38         float: right; 
     38    float: right; 
    3939} 
    4040 
     
    4949.clr 
    5050{ 
    51         width: 0; 
    52         height: 0; 
    53         line-height: 0; 
    54         clear: both; 
     51    width: 0; 
     52    height: 0; 
     53    line-height: 0; 
     54    clear: both; 
    5555} 
    5656 
     
    8484 
    8585.inputs p { 
    86    line-height: 2.1em; 
     86   line-height: 2.1; 
    8787} 
    8888 
     
    115115.tc-mixer-entry 
    116116{ 
    117         display: block; 
    118         float: left; 
    119         margin: 0; 
    120         border: 0; 
    121         padding: 8px; 
    122         height: 120px; 
    123         overflow: clip; 
    124         cursor: pointer; 
    125         -moz-border-radius: 8px; 
     117    display: block; 
     118    float: left; 
     119    margin: 0; 
     120    border: 0; 
     121    padding: 8px; 
     122    height: 120px; 
     123    overflow: clip; 
     124    cursor: pointer; 
     125    -moz-border-radius: 8px; 
    126126} 
    127127 
    128128.tc-mixer-entry img 
    129129{ 
    130         width: 120px; 
    131         height: 90px; 
    132         border: 1px #999 solid; 
    133         margin: 0 0 2px 0; 
     130    width: 120px; 
     131    height: 90px; 
     132    border: 1px #999 solid; 
     133    margin: 0 0 2px 0; 
    134134} 
    135135 
     
    150150#categories hr 
    151151{ 
    152         margin: 4px; 
    153         position: relative; 
    154         clear: both; 
     152    margin: 4px; 
     153    position: relative; 
     154    clear: both; 
    155155} 
    156156 
    157157.hr 
    158158{ 
    159         display: block; 
    160         position: relative; 
    161         height: 0; 
    162         margin: 4px; 
    163         border-bottom: 1px solid #ccc; 
    164         padding: 0; 
    165         line-height: 0; 
     159    display: block; 
     160    position: relative; 
     161    height: 0; 
     162    margin: 4px; 
     163    border-bottom: 1px solid #ccc; 
     164    padding: 0; 
     165    line-height: 0; 
    166166} 
    167167 
    168168.category 
    169169{ 
    170         display: block; 
    171         position: relative; 
    172         clear: both; 
    173         margin: 0; 
    174         border: 0; 
    175         padding: 4px; 
    176         cursor: pointer; 
    177         -moz-border-radius: 8px; 
     170    display: block; 
     171    position: relative; 
     172    clear: both; 
     173    margin: 0; 
     174    border: 0; 
     175    padding: 4px; 
     176    cursor: pointer; 
     177    -moz-border-radius: 8px; 
    178178} 
    179179 
     
    184184.display-mini 
    185185{ 
    186         display: block; 
    187         position: relative; 
    188         left: 22px; 
    189         width: 104px; 
    190         margin: 0; 
    191         border: 0; 
    192         padding: 0; 
    193         line-height: 0; 
     186    display: block; 
     187    position: relative; 
     188    left: 22px; 
     189    width: 400px; 
     190    margin: 0; 
     191    border: 0; 
     192    padding: 0; 
     193    line-height: 0; 
    194194} 
    195195 
    196196html>body .display-mini 
    197197{ 
    198         float: none; 
    199         clear: none; 
     198    float: none; 
     199    clear: none; 
    200200} 
    201201 
    202202.display-mini .tc-mixer-entry 
    203203{ 
    204         display: inline; 
    205         float: none; 
    206         margin: 0 3px 0 0; 
    207         border: 0; 
    208         padding: 0; 
    209         height: auto; 
    210         overflow: clip; 
    211         cursor: pointer; 
    212         -moz-border-radius: 0; 
     204    display: inline; 
     205    float: none; 
     206    margin: 0 3px 0 0; 
     207    border: 0; 
     208    padding: 0; 
     209    height: auto; 
     210    overflow: clip; 
     211    cursor: pointer; 
     212    -moz-border-radius: 0; 
    213213} 
    214214 
    215215.display-mini .tc-mixer-selected 
    216216{ 
    217         background: transparent; 
     217    background: transparent; 
    218218} 
    219219 
    220220.display-mini img 
    221221{ 
    222         width: auto; 
    223         height: 12px; 
    224         margin: 0; 
    225         border: 0; 
    226         padding: 0; 
     222    width: auto; 
     223    height: 12px; 
     224    margin: 0; 
     225    border: 0; 
     226    padding: 0; 
    227227} 
    228228 
    229229.display-mini .title .content 
    230230{ 
    231         display: none; 
     231    display: none; 
    232232} 
    233233 
     
    239239h2 
    240240{ 
    241         font-size: 1em; 
    242         font-weight: bold; 
    243         margin: 0 0 4px 0; 
    244         padding: 0; 
    245         border: 0; 
     241    font-size: 1em; 
     242    font-weight: bold; 
     243    margin: 0 0 4px 0; 
     244    padding: 0; 
     245    border: 0; 
    246246} 
    247247 
     
    249249#hide-details 
    250250{ 
    251         position: absolute; 
    252         right: 0; 
    253         top: 0; 
    254         font-size: 11px; 
     251    position: absolute; 
     252    right: 0; 
     253    top: 0; 
     254    font-size: 11px; 
    255255} 
    256256 
     
    268268#wrapper 
    269269{ 
    270         width: 720px; 
    271         margin: 8px 0px; 
     270    width: 920px; 
     271    margin: 8px 0px; 
    272272} 
    273273 
    274274#template-picker 
    275275{ 
    276         position: relative; 
    277         top: 8px; 
    278         left: 0; 
    279         width: 720px; 
    280         height: 450px; 
     276    position: relative; 
     277    top: 8px; 
     278    left: 0; 
     279    width: 720px; 
     280    height: 450px; 
    281281} 
    282282 
    283283#categories-wrapper 
    284284{ 
    285         position: absolute; 
    286         left: 0; 
    287         top: 0; 
    288         width: 160px; 
     285    position: absolute; 
     286    left: 0; 
     287    top: 0; 
     288    width: 150px; 
    289289} 
    290290 
    291291#templates-wrapper 
    292292{ 
    293         position: absolute; 
    294         left: 172px; 
    295         top: 0; 
    296 } 
    297  
    298 .templates-wrapper-wide { width: 575px; } 
    299 .templates-wrapper-narrow { width: 180px; } 
     293    position: absolute; 
     294    left: 161px; 
     295    top: 0; 
     296    width: 440px; 
     297    height: 450px; 
     298} 
    300299 
    301300#details-wrapper 
    302301{ 
    303         position: absolute; 
    304         left: 364px; 
    305         top: 0; 
    306         width: 356px; 
     302    position: absolute; 
     303    left: 600px; 
     304    top: 0; 
     305    width: 300px; 
    307306} 
    308307 
    309308.scrollbox 
    310309{ 
    311         display: block; 
    312         position: relative; 
    313         top: 0; 
    314         left: 0; 
    315         width: auto; 
    316         height: 410px; 
    317         overflow: auto; 
    318         margin: 0; 
    319         border: 1px #999 solid; 
    320         padding: 4px; 
     310    display: block; 
     311    position: relative; 
     312    top: 0; 
     313    left: 0; 
     314    width: auto; 
     315    height: 410px; 
     316    overflow: auto; 
     317    margin: 0; 
     318    border: 1px #999 solid; 
     319    padding: 4px; 
    321320} 
    322321 
    323322#display-details 
    324323{ 
    325         position: relative; 
    326         left: 0; 
    327         top: 0; 
    328         height: 354px; 
    329         width: auto; 
    330         overflow: clip; 
    331         border: 1px #999 solid; 
    332         background-color: #eee; 
    333         padding: 32px 24px; 
     324    position: relative; 
     325    left: 0; 
     326    top: 0; 
     327    height: 398px; 
     328    width: auto; 
     329    overflow: clip; 
     330    border: 1px #999 solid; 
     331    background-color: #eee; 
     332    padding: 10px 10px; 
     333} 
     334 
     335#select-design-controls { 
     336    position: absolute; 
     337    width: 280px; 
     338    top: auto; 
     339    bottom: 10px; 
     340    margin-right: 10px; 
     341} 
     342 
     343.actions-bar .button-actions { 
     344    float: right; 
    334345} 
    335346 
    336347#display-details .tc-mixer-entry 
    337348{ 
    338         display: block; 
    339         float: none; 
    340         margin: 0; 
    341         border: 0; 
    342         padding: 0; 
    343         height: auto; 
    344         overflow: display; 
     349    display: block; 
     350    float: none; 
     351    margin: 0; 
     352    border: 0; 
     353    padding: 0; 
     354    height: auto; 
     355    overflow: display; 
    345356} 
    346357 
    347358#display-details .tc-mixer-selected 
    348359{ 
    349         background: transparent; 
     360    background: transparent; 
    350361} 
    351362 
     
    364375#display-details .tags .content { display: inline; height: auto; word-spacing: 0.5em; }*/ 
    365376 
    366 #display-details  img { width: 99%; height: auto; margin: 0 0 4px 0; } 
     377#display-details  img { 
     378    width: 278px; 
     379    height: 209px; 
     380    margin: 0 0 4px 0; 
     381} 
  • trunk/StyleCatcher/plugins/StyleCatcher/lib/StyleCatcher/L10N.pm

    r43 r817  
    1 # Copyright 2001-2006 Six Apart. This code cannot be redistributed without 
    2 # permission from www.sixapart.com.  For more information, consult your 
    3 # Movable Type license. 
     1# Movable Type (r) Open Source (C) 2005-2008 Six Apart, Ltd. 
     2# This program is distributed under the terms of the 
     3# GNU General Public License, version 2. 
    44# 
    5 # $Id: L10N.pm 29367 2006-05-20 04:42:10Z bchoate $ 
     5# $Id: L10N.pm 1174 2008-01-08 21:02:50Z bchoate $ 
    66 
    77package StyleCatcher::L10N; 
  • trunk/StyleCatcher/plugins/StyleCatcher/lib/StyleCatcher/L10N/en_us.pm

    r28 r817  
     1# Movable Type (r) Open Source (C) 2005-2008 Six Apart, Ltd. 
     2# This program is distributed under the terms of the 
     3# GNU General Public License, version 2. 
     4# 
     5# $Id: en_us.pm 1174 2008-01-08 21:02:50Z bchoate $ 
     6 
    17package StyleCatcher::L10N::en_us; 
    28 
  • trunk/StyleCatcher/plugins/StyleCatcher/lib/StyleCatcher/L10N/ja.pm

    r68 r817  
     1# Movable Type (r) Open Source (C) 2005-2008 Six Apart, Ltd. 
     2# This program is distributed under the terms of the 
     3# GNU General Public License, version 2. 
     4# 
     5# $Id: ja.pm 2003 2008-04-21 10:34:46Z fumiakiy $ 
     6 
    17package StyleCatcher::L10N::ja; 
    28 
     
    814 
    915%Lexicon = ( 
    10     'Applying...' => '適甚䞭...', 
    11     'Apply Selected Design' => 'デザむンを適甚', 
    12     'Before using StyleCatcher, you must specify the Theme Root URL and Path for the installation in the system-level plugin settings for StyleCatcher.' => 'StyleCatcherを利甚するには、システムメニュヌのStyleCatcherプラグむンの蚭定で、ルヌトURLずルヌトパスを指定する忠
     16 
     17## plugins/StyleCatcher/tmpl/view.tmpl 
     18        'Select a Style' => 'スタむルを遞択', 
     19        '3-Columns, Wide, Thin, Thin' => '3カラム、倧・小・小', 
     20        '3-Columns, Thin, Wide, Thin' => '3カラム、小・倧・小', 
     21        '2-Columns, Thin, Wide' => '2カラム、小・倧', 
     22        '2-Columns, Wide, Thin' => '2カラム、倧・小', 
     23        '2-Columns, Wide, Medium' => '2カラム、倧・䞭', 
     24        '2-Columns, Medium, Wide' => '2カラム、䞭・倧', # Translate - New 
     25        'None available' => '芋぀かりたせん', 
     26        'Applying...' => '適甚䞭...', 
     27        'Apply Design' => 'デザむンを適甚', 
     28        'Error applying theme: ' => 'テヌマを適甚䞭に゚ラヌが発生したした。', 
     29        'The selected theme has been applied, but as you have changed the layout, you will need to republish your blog to apply the new layout.' => 'テヌマを適甚したした。レむアりトも倉曎されたので、再構築する忠
    1330芁がありたす。', 
    14     'Choose this Design' => 'このデザむンを遞択', 
    15     'click here.' => 'ここをクリックしおください。', 
    16     'Configure plugin' => 'プラグむンの構成', 
    17     "Could not create [_1] folder - Check that your 'themes' folder is webserver-writable." => '[_1] ディレクトリを䜜成できたせんでした。Webサヌバヌからテヌマのディレクトリに曞き蟌みができるかどうか確認しおください。', 
    18     'Current Theme' => '珟圚のテヌマ', 
    19     'Current theme for your weblog' => 'ブログの珟圚のテヌマ', 
    20     'Current Themes' => '珟圚のテヌマ', 
    21     'Current themes for your weblogs' => 'ブログの珟圚のテヌマ', 
    22     'Error loading themes! -- [_1]' => 'テヌマをロヌドできたせんでした: [_1]', 
    23     'Find Style' => 'スタむル怜玢', 
    24     'Find Styles' => 'スタむル怜玢', 
    25     'Hide Details' => '詳现を隠す', 
    26     "Install <a href='http://greasemonkey.mozdev.org/'>GreaseMonkey</a>" => "<a href='http://greasemonkey.mozdev.org/'>GreaseMonkey</a>で", 
    27     "StyleCatcher user script." => "StyleCatcherのナヌザヌスクリプトを利甚する", 
    28     "It will take a moment for themes to populate once you click 'Find Style'." => 'スタむル怜玢をクリックするず、テヌマを取り蟌みたす少し時間がかかりたす。', 
    29     'Loading...' => 'ロヌド䞭...', 
    30     'Locally saved themes' => 'ロヌカルに保存されたテヌマ', 
    31     'More Themes' => 'その他のテヌマ', 
    32     'Movable Type styles' => 'Movable Type スタむル', 
    33     'NOTE:' => '泚:', 
    34     ' page.' => 'ペヌゞ', 
    35     'Please click on a theme before attempting to apply a new design to your blog.' => 'ブログに適甚するテヌマをクリックしお遞択しおください。', 
    36     'Please select a weblog to apply this theme.' => 'テヌマを適甚するブログを遞択しおください。', 
    37     'Saved Themes' => '保存枈みテヌマ', 
    38     'Select a Design using StyleCatcher' => 'StyleCatcherでデザむンを遞ぶ', 
    39     'Select a Weblog...' => 'ブログを遞択', 
    40     'Show Details' => '詳现衚瀺', 
    41     'Single themes from the web' => 'その他のテヌマ', 
    42     "StyleCatcher lets you easily browse through styles and then apply them to your blog in just a few clicks. To find out more about Movable Type styles, or for new sources for styles, visit the <a href='http://www.sixapart.com/movabletype/styles'>Movable Type styles</a> page." => "StyleCatcherを䜿うず、ほんの数回クリックするだけでスタむルを探しおブログに適甚するこずができたす。Movable Typeのスタむルに぀いおの詳现やスタむルのé 
     31        'The selected theme has been applied!' => 'テヌマを適甚したした。', 
     32        'Error loading themes! -- [_1]' => 'テヌマの読み蟌みで゚ラヌが発生したした! -- [_1]', 
     33        'Stylesheet or Repository URL' => 'スタむルシヌトたたはリポゞトリのURL', 
     34        'Stylesheet or Repository URL:' => 'スタむルシヌトたたはリポゞトリのURL:', 
     35        'Download Styles' => 'スタむルをダりンロヌド', 
     36        'Current theme for your weblog' => '適甚されおいるテヌマ', 
     37        'Current Style' => '珟圚のスタむル', 
     38        'Locally saved themes' => '保存されおいるテヌマ', 
     39        'Saved Styles' => '保存されおいるスタむル', 
     40        'Default Styles' => '既定のスタむル', 
     41        'Single themes from the web' => 'その他のテヌマ', 
     42        'More Styles' => 'その他のスタむル', 
     43        'Selected Design' => '遞択されたデザむン', 
     44        'Layout' => 'レむアりト', 
     45 
     46## plugins/StyleCatcher/lib/StyleCatcher/CMS.pm 
     47        'Your mt-static directory could not be found. Please configure \'StaticFilePath\' to continue.' => 'mt-staticディレクトリが芋぀かりたせんでした。StaticFilePathを蚭定しおください。', 
     48        'Could not create [_1] folder - Check that your \'themes\' folder is webserver-writable.' => '[_1] フォルダが䜜成できたせん。\'themes\' フォルダが曞き蟌み可胜か確認しおください。', 
     49        'Error downloading image: [_1]' => '画像をダりンロヌドできたせんでした: [_1]', 
     50        'Successfully applied new theme selection.' => '新しいテヌマを適甚したした。', 
     51        'Invalid URL: [_1]' => 'URLが䞍正です: [_1]', 
     52 
     53## plugins/StyleCatcher/stylecatcher.pl 
     54        'StyleCatcher lets you easily browse through styles and then apply them to your blog in just a few clicks. To find out more about Movable Type styles, or for new sources for styles, visit the <a href=\'http://www.sixapart.com/movabletype/styles\'>Movable Type styles</a> page.' => 'StyleCatcherを䜿うず、ほんの数回クリックするだけでスタむルを探しおブログに適甚するこずができたす。Movable Typeのスタむルに぀いおの詳现やスタむルのé 
    4355åžƒå 
    44 ƒã«ã€ã„おは、<a href='http://www.sixapart.com/movabletype/styles'>Movable Type styles</a>のペヌゞ英語ぞアクセスしおください。", 
    45     'StyleCatcher must first be configured system-wide before it can be used.' => 'StyleCatcherを利甚するには、たずシステムレベルで蚭定を行う忠
    46 èŠãŒã‚ã‚ŠãŸã™ã€‚', 
    47     'Style Library URL:' => 'Style LibraryぞのURL:', 
    48     'Successfully applied new theme selection.' => '新しいテヌマを適甚したした。', 
    49     'Theme or Repository URL:' => 'テヌマ/リポゞトリぞのURL:', 
    50     'Theme Root Path:' => 'テヌマのルヌトパス:', 
    51     'Theme Root URL:' => 'テヌマのルヌトURL:', 
    52     'The paths defined here must physically exist and be writable by the webserver.' => 'このパスは物理的に存圚しか぀Webサヌバヌから曞き蟌み可胜でなければなりたせん。', 
    53     ' To change the location of your local theme repository, ' => ' テヌマリポゞトリの堎所を倉えるには ', 
    54     'Unable to create the theme root directory. Error: [_1]' => 'テヌマのルヌトディレクトリを䜜成できたせんでした: [_1]', 
    55     'Unable to write base-weblog.css to themeroot. File Manager gave the error: [_1]. Are you sure your theme root directory is web-server writable?' => 'base-weblog.cssをテヌマのルヌトに曞き蟌めたせんでした: [_1]。Webサヌバヌからテヌマのルヌトディレクトリに曞き蟌みができるかどうか確認しおください。', 
    56     q{You don't appear to have any weblogs with a 'styles-site.css' template that you have rights to edit. Please check your weblog(s) for this template.} => 'styles-site.cssテンプレヌトを利甚しおいるブログがありたせん。このテンプレヌトをブログで確認しおください。', 
    57     q{You must define a global theme repository where themes can be stored locally.  If a particular blog has not been configured for it's own theme paths, it will use these settings. If a blog has it's own theme paths, then the theme will be copied to that location when applied to that weblog.} => 'テヌマを保存するためのグロヌバルテヌマディレクトリを指定しおください。ブログごずの蚭定で䞊曞きしない限り、ここでの蚭定が利甚されたす。ブログの蚭定で䞊曞きした堎合、テヌマはブログに適甚されたずきにその堎所ぞコピヌされたす。', 
    58     q{Your theme URL and path can be customized for this weblog.} => 'このブログ甚にテヌマのURLずパスをカスタマむズできたす。',  
    59     "<p>You must define a global theme repository where themes can be stored locally.  If a particular blog has not been configured for it's own theme paths, it will use these settings directly. If a blog has it's own theme paths, then the theme will be copied to that location when applied to that weblog. The paths defined here must physically exist and be writable by the webserver.</p>" => '<p>テヌマを保存するためのグロヌバルテヌマディレクトリを指定しおください。ブログごずの蚭定で䞊曞きしない限り、ここでの蚭定が利甚されたす。ブログの蚭定で䞊曞きした堎合、テヌマはブログに適甚されたずきにその堎所ぞコピヌされたす。このパスは物理的に存圚しか぀Webサヌバヌから曞き蟌み可胜でなければなりたせん。</p>', 
    60     '<p style="color: #f00;"><strong>NOTE:</strong> StyleCatcher must first be configured from the system-level plugins listing before it can be used on any blog.</p>' => '<p style="color: #f00;"><strong>泚意</strong>StyleCatcherを利甚するには、たずシステムレベルで蚭定を行う忠
    61 èŠãŒã‚ã‚ŠãŸã™ã€‚', 
    62     "<p>If you wish to store your themes locally for this blog, you can configure your theme URL and path below.  Although downloaded themes will still be stored in the system-level directory, they will be copied to this directory when they are applied. The paths defined here must physically exist and be writable by the webserver.</p>" => '<p>テヌマのファむルをブログごずに保存したい堎合は、テヌマのURLずパスを以䞋に蚭定しおください。ダりンロヌドされたテヌマはシステムレベルで蚭定したディレクリに保存されたすが、ブログに適甚すればここで指定したディレクトリにもコピヌされたす。このパスは物理的に存圚しか぀Webサヌバヌから曞き蟌み可胜でなければなりたせん。</p>', 
    63  
    64  
     56ƒã«ã€ã„おは、<a href=\'http://www.sixapart.com/movabletype/styles\'>Movable Type styles</a>のペヌゞ英語ぞアクセスしおください。', 
     57        'MT 4 Style Library' => 'MT 4 スタむルラむブラリ', 
     58        'A collection of styles compatible with Movable Type 4 default templates.' => 'Movable Type 4のデフォルトテンプレヌトず互換性のあるスタむルです。', 
     59        'MT 3 Style Library' => 'MT 3 スタむルラむブラリ', 
     60        'A collection of styles compatible with Movable Type 3.3+ default templates.' => 'Movable Type 3.3xのデフォルトテンプレヌトず互換性のあるスタむルです。', 
     61        'Styles' => 'スタむル', 
    6562); 
    6663 
  • trunk/StyleCatcher/plugins/StyleCatcher/stylecatcher.pl

    r100 r817  
    1 # Copyright 2005-2006 Six Apart. This code cannot be redistributed without 
    2 # permission from www.sixapart.com. 
     1# Movable Type (r) Open Source (C) 2005-2008 Six Apart, Ltd. 
     2# This program is distributed under the terms of the 
     3# GNU General Public License, version 2. 
    34# 
    4 # $Id: stylecatcher.pl 32007 2006-06-22 01:11:47Z jallen $ 
     5# $Id: stylecatcher.pl 1568 2008-03-25 00:48:27Z bsmith $ 
    56 
    67package MT::Plugin::StyleCatcher; 
     
    89use strict; 
    910use base 'MT::Plugin'; 
    10 use vars qw($VERSION); 
    11 $VERSION = '1.1-dev'; 
     11our $VERSION = '2.0'; 
    1212 
    1313my $plugin; 
    1414$plugin = MT::Plugin::StyleCatcher->new({ 
     15    id => 'StyleCatcher', 
    1516    name => "StyleCatcher", 
    1617    version => $VERSION, 
    1718    doc_link => "http://www.sixapart.com/movabletype/styles/", 
    18     description => "<MT_TRANS phrase=\"StyleCatcher lets you easily browse through styles and then apply them to your blog in just a few clicks. To find out more about Movable Type styles, or for new sources for styles, visit the <a href='http://www.sixapart.com/movabletype/styles'>Movable Type styles</a> page.\">", 
    19     config_link => "stylecatcher.cgi", 
    20     author_name => "Nick O'Neil, Brad Choate", 
    21     author_link => "http://www.authenticgeek.net/", 
     19    description => q(<MT_TRANS phrase="StyleCatcher lets you easily browse through styles and then apply them to your blog in just a few clicks. To find out more about Movable Type styles, or for new sources for styles, visit the <a href='http://www.sixapart.com/movabletype/styles'>Movable Type styles</a> page.">), 
     20    author_name => "Six Apart, Ltd.", 
     21    author_link => "http://www.sixapart.com/", 
    2222    l10n_class => 'StyleCatcher::L10N', 
    23     config_template => \&configuration_template, 
    24     settings => new MT::PluginSettings([ 
    25         ['webthemeroot'], 
    26         ['themeroot'], 
    27         ['stylelibrary'], 
    28     ]), 
     23    registry => { 
     24        stylecatcher_libraries => { 
     25            'sixapart_mt4' => { 
     26                url => 'http://www.sixapart.com/movabletype/styles/mt4/library', 
     27                label => 'MT 4 Style Library', 
     28                description_label => "A collection of styles compatible with Movable Type 4 default templates.", 
     29                order => 1, 
     30            }, 
     31            # 'sixapart_mt3' => { 
     32            #     url => 'http://www.sixapart.com/movabletype/styles/mt3/library', 
     33            #     label => 'MT 3 Style Library', 
     34            #     description_label => "A collection of styles compatible with Movable Type 3.3+ default templates.", 
     35            #     order => 1000, 
     36            # }, 
     37        }, 
     38        applications => { 
     39            cms => { 
     40                methods => { 
     41                    stylecatcher_theme => '$StyleCatcher::StyleCatcher::CMS::view', 
     42                    stylecatcher_js => '$StyleCatcher::StyleCatcher::CMS::js', 
     43                    stylecatcher_apply => '$StyleCatcher::StyleCatcher::CMS::apply', 
     44                }, 
     45                menus => { 
     46                    'design:theme' => { 
     47                        label => 'Styles', 
     48                        order => 300, 
     49                        mode => 'stylecatcher_theme', 
     50                        view => "blog", 
     51                        permission => 'edit_templates', 
     52                    }, 
     53                }, 
     54            }, 
     55        }, 
     56    }, 
    2957}); 
    3058MT->add_plugin($plugin); 
    31 MT->add_plugin_action('list_template', 'stylecatcher.cgi', 'Select a Design using StyleCatcher'); 
    32 MT->add_plugin_action('blog','stylecatcher.cgi?', "Select a Design using StyleCatcher"); 
    3359 
    3460sub instance { $plugin } 
    3561 
    36 sub configuration_template { 
    37     my $plugin = shift; 
    38     my ($param, $scope) = @_; 
    39  
    40     my $intro; 
    41     if ($scope eq 'system') { 
    42         if (!$param->{webthemeroot}) { 
    43             $param->{webthemeroot} = MT->instance->static_path; 
    44             $param->{webthemeroot} =~ s!/$!!; 
    45             $param->{webthemeroot} .= '/themes/'; 
    46         } 
    47         $param->{themeroot} ||= File::Spec->catdir(MT->instance->mt_dir, 'mt-static', 'themes'); 
    48         $param->{stylelibrary} ||= $StyleCatcher::DEFAULT_STYLE_LIBRARY; 
    49         $intro = q{<MT_TRANS phrase="<p>You must define a global theme repository where themes can be stored locally.  If a particular blog has not been configured for it's own theme paths, it will use these settings directly. If a blog has it's own theme paths, then the theme will be copied to that location when applied to that weblog. The paths defined here must physically exist and be writable by the webserver.</p>">}; 
    50     } else { 
    51  
    52         my $system_plugin_config = $plugin->get_config_hash(); 
    53         unless ($system_plugin_config && $system_plugin_config->{webthemeroot} && $system_plugin_config->{themeroot}) { 
    54             return q{<MT_TRANS phrase="<p style="color: #f00;"><strong>NOTE:</strong> StyleCatcher must first be configured from the system-level plugins listing before it can be used on any blog.</p>">};     
    55           } 
    56              
    57         if (my $blog = MT->instance->blog) { 
    58             if (!$param->{webthemeroot}) { 
    59                 my $url = $blog->site_url; 
    60                 $url =~ s!/$!!; 
    61                 $url .= '/themes/'; 
    62                 $param->{webthemeroot} = $url; 
    63             } 
    64             if (!$param->{themeroot}) { 
    65                 my $path = $blog->site_path; 
    66                 $path = File::Spec->catdir($path, 'themes'); 
    67                 $param->{themeroot} = $path; 
    68             } 
    69         } 
    70         $intro = q{<MT_TRANS phrase="<p>If you wish to store your themes locally for this blog, you can configure your theme URL and path below.  Although downloaded themes will still be stored in the system-level directory, they will be copied to this directory when they are applied. The paths defined here must physically exist and be writable by the webserver.</p>">}; 
    71  
    72     } 
    73  
    74     return qq{ 
    75 $intro 
    76  
    77 <div class="setting"> 
    78 <div class="label"><label for="stycat_webthemeroot"><MT_TRANS phrase="Theme Root URL:"></label></div> 
    79 <div class="field"> 
    80 <input type="text" name="webthemeroot" id="stycat_webthemeroot" value="<TMPL_VAR NAME=WEBTHEMEROOT ESCAPE=HTML>" style="width: 95%" /> 
    81 </div> 
    82 </div> 
    83  
    84 <div class="setting"> 
    85 <div class="label"><label for="stycat_themeroot"><MT_TRANS phrase="Theme Root Path:"></label></div> 
    86 <div class="field"> 
    87 <input type="text" name="themeroot" id="stycat_themeroot" value="<TMPL_VAR NAME=THEMEROOT ESCAPE=HTML>" style="width: 95%" /> 
    88 </div> 
    89 </div> 
    90  
    91 <div class="setting"> 
    92 <div class="label"><label for="stycat_stylelibrary"><MT_TRANS phrase="Style Library URL:"></label></div> 
    93 <div class="field"> 
    94 <input type="text" name="stylelibrary" id="stycat_stylelibrary" value="<TMPL_VAR NAME=STYLELIBRARY ESCAPE=HTML>" style="width: 95%" /> 
    95 </div> 
    96 </div> 
    97     }; 
    98 } 
    99  
    100 sub save_config { 
    101     my $plugin = shift; 
    102     my ($param, $scope) = @_; 
    103     my $themeroot = $param->{themeroot}; 
    104     return 1 unless $themeroot; 
    105  
    106     my $app = MT->instance; 
    107  
    108     require MT::FileMgr; 
    109     my $filemgr = MT::FileMgr->new('Local') 
    110         or return $app->error(MT::FileMgr->errstr); 
    111  
    112     my $base_weblog_path = File::Spec->catfile($plugin->{full_path}, 
    113                                                "base-weblog.css"); 
    114     my $base_weblog = $filemgr->get_data($base_weblog_path); 
    115     $filemgr->mkpath($param->{themeroot}) 
    116         or die $plugin->translate("Unable to create the theme root directory. Error: [_1]", $filemgr->errstr); 
    117  
    118     defined($filemgr->put_data($base_weblog, 
    119         File::Spec->catfile($param->{themeroot}, "base-weblog.css"))) 
    120         or die $plugin->translate("Unable to write base-weblog.css to themeroot. File Manager gave the error: [_1]. Are you sure your theme root directory is web-server writable?", $filemgr->errstr); 
    121  
    122     return $plugin->SUPER::save_config(@_); 
    123 } 
    124  
    125621; 
  • trunk/StyleCatcher/plugins/StyleCatcher/tmpl/view.tmpl

    r68 r817  
    1 <TMPL_INCLUDE NAME="header.tmpl"> 
     1<mt:setvarblock name="page_title"><__trans phrase="Select a Style"></mt:setvarblock> 
     2<mt:setvarblock name="html_head" append="1"> 
     3<!-- stylecatcher --> 
     4<link rel="stylesheet" type="text/css" title="Default Layout" href="<mt:var name="plugin_static_uri">templates.css" /> 
     5 
     6<script type="text/javascript" src="<mt:var name="static_uri">js/tc/mixer.js"></script> 
     7<script type="text/javascript" src="<mt:var name="static_uri">js/tc/mixer/tagmatch.js"></script> 
     8<script type="text/javascript" src="<mt:var name="static_uri">js/tc/mixer/display.js"></script> 
     9<script type="text/javascript" src="<mt:var name="static_uri">js/tc/client.js"></script> 
    210 
    311<!-- javascripts for this page --> 
    412 
    5         <script type="text/javascript"> 
    6             var repoImg = "<TMPL_VAR NAME=PLUGIN_STATIC_URI>images/mixed-media.gif"; 
    7             var selected; 
    8             var selected_blog_id; 
    9             var mixer;           
    10             var matchCategory = /^category-/; 
    11             var categories = []; 
    12             var firstCategoryId; 
    13             var repo_urls = {}; 
    14             var repos = []; 
    15  
    16             TC.attachLoadEvent( init ); 
    17  
    18             function init() { 
    19                 initMixer(); 
    20                 showDetails( false ); 
    21  
    22 <TMPL_IF NAME=THEMES_JSON> 
    23                 var data = <TMPL_VAR NAME=THEMES_JSON>; 
    24                 if (data.categories) { 
    25                     for (var i = 0; i < data.categories.length; i++) 
    26                         enableCategory(data.categories[i]); 
    27                 } 
    28 </TMPL_IF> 
    29  
    30                 initCategories(); 
    31                 chooseCategory( firstCategoryId ); 
    32  
    33                 if (data.themes) 
    34                     loadThemes(data.themes, 'local'); 
    35  
    36                 <TMPL_IF NAME=AUTO_FETCH> 
    37                 getStyles(); 
    38                 </TMPL_IF> 
    39             } 
    40  
    41             function enableCategory(cat) { 
    42                 mixer.addTagIndexDisplay('display-'+cat, 1000, 'collection:'+cat); 
    43                 var el = document.getElementById('category-' + cat); 
    44                 if (el) 
    45                     el.style.display = 'block'; 
    46             } 
    47  
    48             function initMixer() 
    49             { 
    50                 mixer = new TC.Mixer(); 
    51                 // initialize mixer object 
    52                 mixer.addSelectedDisplay( "display-details" ); 
    53             } 
    54  
    55             function initCategories() 
    56             { 
    57                 var element = document.getElementById( "categories" ); 
    58                 if( !element ) 
    59                     return; 
    60                  
    61                 categories.length = 0; 
    62                 var elements = element.childNodes; 
    63                 for( var i = 0; i < elements.length; i++ ) 
    64                 { 
    65                     element = elements[ i ]; 
    66                     var categoryId = element.id; 
    67                     if( !categoryId ) 
    68                         continue; 
    69                      
    70                     if( !firstCategoryId ) { 
    71                         if (element.style.display != 'none') { 
    72                             firstCategoryId = categoryId; 
     13<script type="text/javascript"> 
     14/* <![CDATA[ */ 
     15    var repoImg = "<mt:var name="plugin_static_uri">images/mixed-media.gif"; 
     16    var selected; 
     17    var blog_id = '<mt:var name="blog_id" escape="js">'; 
     18    var dynamic_blog = <mt:if name="dynamic_blog">true<mt:else>false</mt:if>; 
     19    var mixer;           
     20    var matchCategory = /^category-/; 
     21    var categories = []; 
     22    var firstCategoryId; 
     23    var repo_urls = {}; 
     24    var repos = []; 
     25    var libraries = <mt:var name="style_library" to_json="1">; 
     26    var current_theme = '<mt:var name="current_theme">'; 
     27    var current_layout = '<mt:var name="current_layout">'; 
     28    var layout_names = { 
     29        "layout-wtt": "<__trans phrase="3-Columns, Wide, Thin, Thin" escape="js">", 
     30        "layout-twt": "<__trans phrase="3-Columns, Thin, Wide, Thin" escape="js">", 
     31        "layout-tw": "<__trans phrase="2-Columns, Thin, Wide" escape="js">", 
     32        "layout-wt": "<__trans phrase="2-Columns, Wide, Thin" escape="js">", 
     33        "layout-wm": "<__trans phrase="2-Columns, Wide, Medium" escape="js">", 
     34        "layout-mw": "<__trans phrase="2-Columns, Medium, Wide" escape="js">" 
     35    }; 
     36 
     37    TC.attachLoadEvent( init ); 
     38 
     39    function init() { 
     40        initMixer(); 
     41 
     42<mt:if name="themes_json"> 
     43        var data = <mt:var name="themes_json">; 
     44        if (data.categories) { 
     45            for (var i = 0; i < data.categories.length; i++) 
     46                enableCategory(data.categories[i]); 
     47        } 
     48</mt:if> 
     49 
     50        initCategories(); 
     51        chooseCategory( firstCategoryId ); 
     52 
     53        if (data.themes) { 
     54            loadThemes(data.themes); 
     55            if (current_theme) { 
     56                mixer.name = current_theme; 
     57                selectDesign(); 
     58            } else { 
     59                showDetails(); 
     60            } 
     61        } 
     62 
     63        <mt:if name="auto_fetch"> 
     64        getStyles(); 
     65        </mt:if> 
     66    } 
     67 
     68    function enableCategory(cat) { 
     69        mixer.addTagIndexDisplay('display-'+cat, 1000, 'collection:'+cat); 
     70        var el = getByID('category-' + cat); 
     71        if (el) 
     72            el.style.display = 'block'; 
     73    } 
     74 
     75    function initMixer() { 
     76        mixer = new TC.Mixer(); 
     77        // initialize mixer object 
     78        mixer.addSelectedDisplay( "display-details-content" ); 
     79        mixer.onselect = selectDesign; 
     80    } 
     81 
     82    function initCategories() { 
     83        var element = getByID( "categories" ); 
     84        if( !element ) 
     85            return; 
     86         
     87        categories.length = 0; 
     88        var elements = element.childNodes; 
     89        for( var i = 0; i < elements.length; i++ ) 
     90        { 
     91            element = elements[ i ]; 
     92            var categoryId = element.id; 
     93            if( !categoryId ) 
     94                continue; 
     95             
     96            if( !firstCategoryId ) { 
     97                if (element.style.display != 'none') { 
     98                    firstCategoryId = categoryId; 
     99                } 
     100            } 
     101             
     102            var displayId = categoryId.replace( matchCategory, "display-" ); 
     103            var display = getByID( displayId ); 
     104 
     105            element.onclick = chooseCategoryClosure( categoryId ); 
     106            TC.removeClassName( element, "category-selected" ); 
     107 
     108            categories[ categoryId ] = { 
     109                "element" : element, 
     110                "display" : display 
     111            }; 
     112        } 
     113    } 
     114 
     115    function chooseCategoryClosure( categoryId ) { 
     116        var func = function() { return chooseCategory( categoryId ); }; 
     117        return func; 
     118    } 
     119 
     120    function chooseCategory( categoryId ) { 
     121        var titleElement = getByID( "selected-category-title" ); 
     122 
     123        for( var id in categories ) { 
     124            var element = categories[ id ].element; 
     125            if (!element) continue; 
     126            var display = categories[ id ].display; 
     127 
     128            if( id == categoryId ) { 
     129                var repo_match = element.id.match(/^category-repo-(.+)$/); 
     130                if (repo_match) { 
     131                    var repo_id = repo_match[1]; 
     132                    var repo; 
     133                    for (var i = 0; i < libraries.length; i++) { 
     134                        if (libraries[i].key == repo_id) { 
     135                            repo = libraries[i]; 
     136                            break; 
    73137                        } 
    74138                    } 
    75                      
    76                     var displayId = categoryId.replace( matchCategory, "display-" ); 
    77                     var display = document.getElementById( displayId ); 
    78                      
    79                     element.onclick = chooseCategoryClosure( categoryId ); 
    80                     TC.removeClassName( element, "category-selected" ); 
    81                      
    82                     categories[ categoryId ] = 
    83                     { 
    84                         "element" : element, 
    85                         "display" : display 
    86                     }; 
    87                 } 
    88             } 
    89  
    90             function chooseCategoryClosure( categoryId ) 
    91             { 
    92                 var func = function() { return chooseCategory( categoryId ); }; 
    93                 return func; 
    94             } 
    95  
    96             function chooseCategory( categoryId ) 
    97             { 
    98                 var titleElement = document.getElementById( "selected-category-title" ); 
     139                    if (repo.url && !repo.loaded) { 
     140                        getStyles(repo_id, repo.url); 
     141                    } 
     142                } 
     143                TC.addClassName( element, "category-selected" ); 
     144                display.style.display = "block"; 
    99145                 
    100                 for( var id in categories ) 
    101                 { 
    102                     var element = categories[ id ].element; 
    103                     var display = categories[ id ].display; 
    104  
    105                     if( id == categoryId ) 
    106                     { 
    107                         TC.addClassName( element, "category-selected" ); 
    108                         display.style.display = "block"; 
    109                          
    110                         if( titleElement ) 
    111                             titleElement.innerHTML = trans(element.firstChild.nextSibling.innerHTML); 
    112                         if (element.title.match(/^https?:/)) { 
    113                             var url_element = getByID("repo-url"); 
    114                             url_element.value = element.title; 
     146                if( titleElement ) 
     147                    titleElement.innerHTML = trans(element.firstChild.nextSibling.innerHTML); 
     148            } 
     149            else { 
     150                TC.removeClassName( element, "category-selected" ); 
     151                if (display) display.style.display = "none"; 
     152            } 
     153        } 
     154 
     155        // select first theme in category 
     156        mixer.name = ''; 
     157        var select_design = getByID("select-design-controls"); 
     158        TC.addClassName(select_design, "hidden"); 
     159        mixer.display(); 
     160        mixer.remix(); 
     161    } 
     162 
     163    function showDetails() { 
     164        mixer.remix(); 
     165    } 
     166 
     167    function selectDesign() { 
     168        var apply_button = getByID("apply-button"); 
     169        var layout_select = getByID("layout-list"); 
     170 
     171        var layouts; 
     172        if (mixer.name && mixer.entries[mixer.name]) 
     173            layouts = mixer.entries[mixer.name].layouts; 
     174        var layout_list; 
     175        if (layouts) layout_list = layouts.split(/\s*,\s*/); 
     176        if (layouts && layout_list && layout_list.length) { 
     177            layout_select.options.length = 0; 
     178            var selected_layout = 0; 
     179            for (var i = 0; i < layout_list.length; i++) { 
     180                var opt = new Option(layout_names[layout_list[i]] ? layout_names[layout_list[i]] : layout_list[i], layout_list[i]); 
     181                layout_select.options[layout_select.options.length] = opt; 
     182                if (layout_list[i] == current_layout) { 
     183                    selected_layout = i; 
     184                } 
     185            } 
     186            layout_select.selectedIndex = selected_layout; 
     187            layout_select.disabled = false; 
     188        } else { 
     189            layout_select.options.length = 0; 
     190            layout_select.options[0] = new Option("<__trans phrase="None available" escape="js">", ""); 
     191            layout_select.disabled = true; 
     192        } 
     193        showDetails(); 
     194        var select_design = getByID("select-design-controls"); 
     195        TC.removeClassName(select_design, "hidden"); 
     196        updateApplyButton(); 
     197    } 
     198 
     199    function updateApplyButton() { 
     200        var apply_button = getByID("apply-button"); 
     201        var layout_select = getByID("layout-list"); 
     202        var new_layout; 
     203        if (layout_select && layout_select.selectedIndex != -1) { 
     204            new_layout = layout_select.options[layout_select.selectedIndex].value; 
     205        } 
     206        var current_entry = mixer.entries[mixer.name]; 
     207        if ((mixer.name == current_theme) && ((!new_layout || !current_layout) || ((new_layout && current_layout) && (new_layout == current_layout)))) { 
     208            // same theme, same layout. don't allow apply design to be enabled 
     209            apply_button.disabled = true; 
     210            TC.addClassName(apply_button, "disabled-button"); 
     211        } else { 
     212            apply_button.disabled = false; 
     213            TC.removeClassName(apply_button, "disabled-button"); 
     214        } 
     215    } 
     216 
     217    function applyDesign() { 
     218        // disable apply button; change text to "Applying..." 
     219        var btn = getByID("apply-button"); 
     220        var layout = getByID("layout-list"); 
     221        if (layout && layout.selectedIndex != -1) { 
     222            layout = layout.options[layout.selectedIndex].value; 
     223        } 
     224 
     225        selected = mixer.name; 
     226        var url = mixer.entries[mixer.name].url; 
     227 
     228        TC.addClassName(btn, "disabled-button"); 
     229        btn.disabled = true; 
     230        btn.value = "<__trans phrase="Applying..." escape="js">"; 
     231 
     232        var args = { 
     233            '__mode': 'stylecatcher_apply', 
     234            'url': url, 
     235            'magic_token': '<mt:var name="magic_token">', 
     236            'blog_id': blog_id, 
     237            'name': mixer.name 
     238        }; 
     239        if (layout) 
     240            args['layout'] = layout; 
     241        var client = TC.Client.call({ 
     242            'load': designApplied, 
     243            'uri': '<mt:var name="script_url">', 
     244            'method': 'POST', 
     245            'arguments': args 
     246        }); 
     247    } 
     248 
     249    function designApplied(client, result) { 
     250        var btn = getByID("apply-button"); 
     251        btn.value = "<__trans phrase="Apply Design" escape="js">"; 
     252 
     253        var res; 
     254        try { 
     255            res = eval('(' + result + ')'); 
     256        } catch (e) { 
     257        } 
     258        if (res && res.error) { 
     259            showMsg("<__trans phrase="Error applying theme: " escape="js">" + res.error, "theme-applied", "error"); 
     260            TC.removeClassName(btn, "disabled-button"); 
     261            btn.disabled = false; 
     262            return; 
     263        } 
     264 
     265        var layout = getByID("layout-list"); 
     266        var new_layout; 
     267        if (layout && layout.selectedIndex != -1) { 
     268            new_layout = layout.options[layout.selectedIndex].value; 
     269        } 
     270        var entry = mixer.entries[selected]; 
     271        if (entry) { 
     272            // make this the new 'current' theme 
     273            var found = false; 
     274            for (var i = 0; i < entry.tags.length; i++) { 
     275                if (entry.tags[i] == 'collection:current') 
     276                    found = true; 
     277            } 
     278            if (!found) 
     279                entry.tags[entry.tags.length] = 'collection:current'; 
     280            /* we need to add the blog id of the blog that was 
     281               applied to for this entry */ 
     282 
     283            found = false; 
     284            if (entry.blogs && entry.blogs.length) { 
     285                for (var i = 0; i < entry.blogs.length; i++) { 
     286                    if (entry.blogs[i] == blog_id) 
     287                        found = true; 
     288                } 
     289            } 
     290            if (!found) 
     291                entry.blogs[entry.blogs.length] = blog_id; 
     292 
     293            /* loop through all the 'current' themes and strip 
     294               this blog id from any that don't match the 
     295               selected theme */ 
     296            for (var i in mixer.entries) { 
     297                if (i == selected) 
     298                    continue; 
     299                for (var j = 0; j < mixer.entries[i].blogs.length; j++) { 
     300                    if (mixer.entries[i].blogs[j] == blog_id) { 
     301                        mixer.entries[i].blogs.splice(j,1); 
     302                        break; 
     303                    } 
     304                } 
     305                if (mixer.entries[i].blogs.length == 0) { 
     306                    // no longer 'current' 
     307                    for (var j = 0; j < mixer.entries[i].tags.length; j++) { 
     308                        if (mixer.entries[i].tags[j] == 'collection:current') { 
     309                            mixer.entries[i].tags.splice(j,1); 
     310                            break; 
    115311                        } 
    116312                    } 
    117                     else 
    118                     { 
    119                         TC.removeClassName( element, "category-selected" ); 
    120                         display.style.display = "none"; 
    121                     } 
    122                 } 
    123                  
    124                 mixer.display(); 
    125             } 
    126  
    127             function showDetails( show ) 
    128             { 
    129                 var showElement = document.getElementById( "show-details" ); 
    130                 var hideElement = document.getElementById( "hide-details" ); 
    131                 var detailsElement = document.getElementById( "details-wrapper" ); 
    132                 var templatesElement = document.getElementById( "templates-wrapper" ); 
    133                  
    134                 if( show ) 
    135                 { 
    136                     showElement.style.display = "none"; 
    137                     hideElement.style.display = "block"; 
    138                     detailsElement.style.display = "block"; 
    139                     TC.removeClassName( templatesElement, "templates-wrapper-wide" ); 
    140                     TC.addClassName( templatesElement, "templates-wrapper-narrow" ); 
    141                 } 
    142                 else 
    143                 { 
    144                     showElement.style.display = "block"; 
    145                     hideElement.style.display = "none"; 
    146                     detailsElement.style.display = "none"; 
    147                     TC.addClassName( templatesElement, "templates-wrapper-wide" ); 
    148                     TC.removeClassName( templatesElement, "templates-wrapper-narrow" ); 
    149                 } 
    150                  
    151                 return false; 
    152             } 
    153  
    154             function applyDesign() { 
    155                 // disable apply button; change text to "Applying..." 
    156 <TMPL_IF NAME=SINGLE_BLOG> 
    157                 var blog_id = '<TMPL_VAR NAME=SINGLE_BLOG>'; 
    158 <TMPL_ELSE> 
    159                 var sel = getByID("select-blog"); 
    160                 var blog_id = sel.options[sel.selectedIndex].value; 
    161                 if (!blog_id) { 
    162                     alert("<MT_TRANS phrase="Please select a weblog to apply this theme.">"); 
    163                     return; 
    164                 } 
    165 </TMPL_IF> 
    166                 var btn = getByID("apply-button"); 
    167                 if (!btn) return; 
    168  
    169                 selected = mixer.name; 
    170                 if (!selected) { 
    171                     alert("<MT_TRANS phrase="Please click on a theme before attempting to apply a new design to your blog.">"); 
    172                     return; 
    173                 } 
    174                 var url = mixer.entries[mixer.name].url; 
    175  
    176                 btn.disabled = true; 
    177                 btn.value = "<MT_TRANS phrase="Applying...">"; 
    178                 selected_blog_id = blog_id; 
    179                 var client = TC.Client.call({ 
    180                     'load': designApplied, 
    181                     'uri': '<TMPL_VAR NAME=SCRIPT_URL>', 
    182                     'method': 'POST', 
    183                     'arguments': { 
    184                         '__mode': 'apply', 
    185                         'url': url, 
    186                         'magic_token': '<TMPL_VAR NAME=MAGIC_TOKEN>', 
    187                         'blog_id': blog_id 
    188                     } 
    189                 }); 
    190             } 
    191  
    192             function designApplied(client, result) { 
    193                 var btn = getByID("apply-button"); 
    194                 var entry = mixer.entries[selected]; 
    195                 if (entry) { 
    196                     // make this the new 'current' theme 
    197                     var found = false; 
    198                     for (var i = 0; i < entry.tags.length; i++) { 
    199                         if (entry.tags[i] == 'collection:current') 
    200                             found = true; 
    201                     } 
    202                     if (!found) 
    203                         entry.tags[entry.tags.length] = 'collection:current'; 
    204                     /* we need to add the blog id of the blog that was 
    205                        applied to for this entry */ 
    206  
    207                     found = false; 
    208                     if (entry.blogs && entry.blogs.length) { 
    209                         for (var i = 0; i < entry.blogs.length; i++) { 
    210                             if (entry.blogs[i] == selected_blog_id) 
    211                                 found = true; 
     313                } 
     314            } 
     315            mixer.createTagIndexes(); 
     316        } 
     317 
     318        chooseCategory('category-current'); 
     319        current_theme = selected; 
     320        mixer.name = selected; 
     321        var layout_changed = (current_layout && new_layout) && (current_layout != new_layout); 
     322        current_layout = new_layout; 
     323        selectDesign(); 
     324 
     325        if (layout_changed && (!dynamic_blog)) { 
     326            showMsg("<__trans phrase="The selected theme has been applied, but as you have changed the layout, you will need to republish your blog to apply the new layout." escape="js">", 'theme-applied', "info", "all", blog_id); 
     327        } else { 
     328            showMsg("<__trans phrase="The selected theme has been applied!" escape="js">", 'theme-applied', "info"); 
     329        } 
     330    } 
     331 
     332    function stylesLoaded(client, styles, repo_id) { 
     333        var btn = getByID("find-button"); 
     334        TC.addClassName(TC.elementOrId("loading-styles"), "hidden"); 
     335        TC.removeClassName(btn, "hidden"); 
     336 
     337        var repo_num; 
     338        var cat; 
     339 
     340        var data; 
     341        try { 
     342            data = eval('('+styles+')'); 
     343        } catch (e) { 
     344            showMsg("<__trans phrase="Error loading themes! -- [_1]" params="ERROR" escape="js">".replace(/ERROR/, styles), "error", "error"); 
     345            return; 
     346        } 
     347        if (data.error) { 
     348            showMsg("<__trans phrase="Error loading themes! -- [_1]" params="ERROR" escape="js">".replace(/ERROR/, data.error), "error", "error"); 
     349            return; 
     350        } 
     351        log(data.result); 
     352        if (!repo_id) { 
     353            if (data.result.repo) { 
     354                url = data.result.repo['url']; 
     355                if (repo_urls[url] != undefined) { 
     356                    repo_num = repo_urls[url]; 
     357                    cat = 'repo_' + repo_num; 
     358                } else { 
     359                    repo_num = repos.length; 
     360                    repo_urls[url] = repo_num; 
     361 
     362                    // new repo -- create new 
     363                    // category for it 
     364                    cat = 'repo_' + repo_num; 
     365                    createCategory(cat, data.result.repo['display_name'], url); 
     366                } 
     367                repos[repo_num] = url; 
     368            } 
     369            if (data.result.auto) { 
     370                cat = 'more'; 
     371                enableCategory(cat); 
     372            } 
     373            chooseCategory('category-' + cat); 
     374        } else { 
     375            var repo; 
     376            for (var i = 0; i < libraries.length; i++) { 
     377                if (libraries[i].key == repo_id) { 
     378                    repo = libraries[i]; 
     379                    break; 
     380                } 
     381            } 
     382            if (repo) { 
     383                repo.loaded = true; 
     384                cat = 'repo-' + repo_id; 
     385                enableCategory(cat); 
     386                chooseCategory('category-' + cat); 
     387            } 
     388        } 
     389        if (data.result.themes) 
     390            loadThemes(data.result.themes, cat); 
     391    } 
     392 
     393    function createCategory(cat_name, cat_title, url) { 
     394        // things to create... 
     395        //   #1: new scrollbox under id 'categories' 
     396        /* 
     397                <div class="category" id="category-repo" title="Remote Styles" style="display: none"> 
     398                    <img src="<mt:var name="plugin_static_uri">images/mixed-media.gif" alt="" /><span id="repo-name">Remote Styles</span> 
     399                </div> 
     400        */ 
     401        var cats = getByID("categories"); 
     402 
     403        element = document.createElement( "div" ); 
     404        element.title = url; 
     405        element.className = "category"; 
     406        element.id = "category-" + cat_name; 
     407 
     408        var img = document.createElement( "img" ); 
     409        img.src = repoImg; 
     410        img.alt = ""; 
     411        element.appendChild( img ); 
     412 
     413        var spn = document.createElement( "span" ); 
     414        spn.appendChild( document.createTextNode( cat_title ) ); 
     415        element.appendChild( spn ); 
     416 
     417        cats.appendChild( element ); 
     418 
     419        //   #2: new div under id templates-wrapper 
     420        /* 
     421            <div class="scrollbox" id="display-repo" style="display: none;"></div> 
     422        */ 
     423 
     424        var wrapper = getByID("templates-wrapper"); 
     425 
     426        var div = document.createElement( "div" ); 
     427        div.className = "scrollbox"; 
     428        div.id = "display-" + cat_name; 
     429        wrapper.appendChild(div); 
     430        element.onclick = chooseCategoryClosure( element.id ); 
     431 
     432        categories[ element.id ] = 
     433        { 
     434            "element" : element, 
     435            "display" : div 
     436        }; 
     437 
     438        enableCategory(cat_name); 
     439    } 
     440 
     441    function loadThemes(themes, pfx) { 
     442        var names = {}; 
     443        for (var i = 0; i < themes.length; i++) { 
     444            var prefix = themes[i]['prefix']; 
     445            if (!prefix) prefix = pfx; 
     446            var name = prefix + ':' + themes[i]['name']; 
     447            if (names[themes[i]['name']]) { 
     448                names[themes[i]['name']]++; 
     449                name += "_" + names[themes[i]['name']]; 
     450            } else { 
     451                names[name] = 1; 
     452            } 
     453            themes[i]['name'] = name; 
     454            themes[i].tags[themes[i].tags.length] = "collection:"+prefix; 
     455            if (mixer.entries[name]) { 
     456                // merge in tags 
     457                var existing_tags = mixer.entries[name].tags; 
     458                if (existing_tags && existing_tags.length) { 
     459                    var new_tag_names = {}; 
     460                    for (var j in themes[i].tags) 
     461                        new_tag_names[j] = true; 
     462                    for (var j = 0; j < existing_tags.length; j++) { 
     463                        if (!new_tag_names[existing_tags[j]]) { 
     464                            themes[i].tags[themes[i].tags.length] = existing_tags[j]; 
    212465                        } 
    213466                    } 
    214                     if (!found) 
    215                         entry.blogs[entry.blogs.length] = selected_blog_id; 
    216  
    217                     /* loop through all the 'current' themes and strip 
    218                        this blog id from any that don't match the 
    219                        selected theme */ 
    220                     for (var i in mixer.entries) { 
    221                         if (i == selected) 
    222                             continue; 
    223                         for (var j = 0; j < mixer.entries[i].blogs.length; j++) { 
    224                             if (mixer.entries[i].blogs[j] == selected_blog_id) { 
    225                                 mixer.entries[i].blogs.splice(j,1); 
    226                                 break; 
    227                             } 
    228                         } 
    229                         if (mixer.entries[i].blogs.length == 0) { 
    230                             // no longer 'current' 
    231                             for (var j = 0; j < mixer.entries[i].tags.length; j++) { 
    232                                 if (mixer.entries[i].tags[j] == 'collection:current') { 
    233                                     mixer.entries[i].tags.splice(j,1); 
    234                                     break; 
    235                                 } 
    236                             } 
    237                         } 
    238                     } 
    239                     mixer.createTagIndexes(); 
    240                     mixer.remix(); 
    241                 } 
    242                 chooseCategory('category-current'); 
    243                 if (!btn) return; 
    244                 btn.value = "<MT_TRANS phrase="Choose this Design">"; 
    245                 btn.disabled = false; 
    246                 alert(result); 
    247             } 
    248  
    249             function stylesLoaded(client, styles) { 
    250                 var btn = getByID("find-button"); 
    251                 if (!btn) return; 
    252                 var repo_num; 
    253                 var cat; 
    254  
    255                 var data; 
    256                 try { 
    257                     data = eval('('+styles+')'); 
    258                 } catch (e) { 
    259                     alert(trans("Error loading themes! -- [_1]", styles)); 
    260                     btn.value = "<MT_TRANS phrase="Find Style">"; 
    261                     btn.disabled = false; 
    262                     return; 
    263                 } 
    264                 if (data.repo) { 
    265                     url = data.repo['url']; 
    266                     if (repo_urls[url] != undefined) { 
    267                         repo_num = repo_urls[url]; 
    268                         cat = 'repo_' + repo_num; 
    269                     } else { 
    270                         repo_num = repos.length; 
    271                         repo_urls[url] = repo_num; 
    272  
    273                         // new repo -- create new 
    274                         // category for it 
    275                         cat = 'repo_' + repo_num; 
    276                         createCategory(cat, data.repo['display_name'], url); 
    277                     } 
    278                     repos[repo_num] = url; 
    279                 } 
    280                 if (data.auto) { 
    281                     cat = 'more'; 
    282                     enableCategory(cat); 
    283                 } 
    284                 chooseCategory('category-' + cat); 
    285                 if (data.themes) 
    286                     loadThemes(data.themes, cat); 
    287  
    288                 btn.value = "<MT_TRANS phrase="Find Style">"; 
    289                 btn.disabled = false; 
    290             } 
    291  
    292             function createCategory(cat_name, cat_title, url) { 
    293                 // things to create... 
    294                 //   #1: new scrollbox under id 'categories' 
    295                 /* 
    296                         <div class="category" id="category-repo" title="Remote Themes" style="display: none"> 
    297                             <img src="<TMPL_VAR NAME=PLUGIN_STATIC_URI>images/mixed-media.gif" alt="" /><span id="repo-name">Remote Themes</span> 
    298                         </div> 
    299                 */ 
    300                 var cats = getByID("categories"); 
    301  
    302                 element = document.createElement( "div" ); 
    303                 element.title = url; 
    304                 element.className = "category"; 
    305                 element.id = "category-" + cat_name; 
    306  
    307                 var img = document.createElement( "img" ); 
    308                 img.src = repoImg; 
    309                 img.alt = ""; 
    310                 element.appendChild( img ); 
    311  
    312                 var spn = document.createElement( "span" ); 
    313                 spn.appendChild( document.createTextNode( cat_title ) ); 
    314                 element.appendChild( spn ); 
    315  
    316                 cats.appendChild( element ); 
    317  
    318                 //   #2: new div under id templates-wrapper 
    319                 /* 
    320                     <div class="scrollbox" id="display-repo" style="display: none;"></div> 
    321                 */ 
    322  
    323                 var wrapper = getByID("templates-wrapper"); 
    324  
    325                 var div = document.createElement( "div" ); 
    326                 div.className = "scrollbox"; 
    327                 div.id = "display-" + cat_name; 
    328                 wrapper.appendChild(div); 
    329                 element.onclick = chooseCategoryClosure( element.id ); 
    330  
    331                 categories[ element.id ] = 
    332                 { 
    333                     "element" : element, 
    334                     "display" : div 
    335                 }; 
    336  
    337                 enableCategory(cat_name); 
    338             } 
    339  
    340             function loadThemes(themes, prefix) { 
    341                 var names = {}; 
    342                 for (var i = 0; i < themes.length; i++) { 
    343                     var name = prefix + '-' + themes[i]['name']; 
    344                     if (names[themes[i]['name']]) { 
    345                         names[themes[i]['name']]++; 
    346                         name += "_" + names[themes[i]['name']]; 
    347                     } else { 
    348                         names[name] = 1; 
    349                     } 
    350                     themes[i]['name'] = name; 
    351                     themes[i].tags[themes[i].tags.length] = "collection:"+prefix; 
    352                     if (mixer.entries[name]) { 
    353                         // merge in tags 
    354                         var existing_tags = mixer.entries[name].tags; 
    355                         if (existing_tags && existing_tags.length) { 
    356                             var new_tag_names = {}; 
    357                             for (var j in themes[i].tags) 
    358                                 new_tag_names[j] = true; 
    359                             for (var j = 0; j < existing_tags.length; j++) { 
    360                                 if (!new_tag_names[existing_tags[j]]) { 
    361                                     themes[i].tags[themes[i].tags.length] = existing_tags[j]; 
    362                                 } 
    363                             } 
    364                         } 
    365                     } else { 
    366                         mixer.addEntries(themes[i]); 
    367                     } 
    368                 } 
    369                 mixer.display(); 
    370             } 
    371             function getStyles() { 
    372                 var btn = getByID("find-button"); 
    373                 if (!btn) return; 
    374                 btn.disabled = true; 
    375                 btn.value = "<MT_TRANS phrase="Loading...">"; 
    376  
    377                 var el = getByID('repo-url'); 
    378                 if (!el) return; 
    379                 var url = el.value; 
    380                 var client = TC.Client.call({ 
    381                     'load': stylesLoaded, 
    382                     'uri': '<TMPL_VAR NAME=SCRIPT_URL>', 
    383                     'method': 'POST', 
    384                     'arguments': { 
    385                         '__mode': 'js', 
    386                         'url': url 
    387                     } 
    388                 }); 
    389             } 
    390         </script> 
    391  
    392 <!-- end script section --> 
    393  
    394         <div id="wrapper"> 
    395  
    396 <TMPL_IF NAME=BLOG_LOOP> 
    397  
    398          <p><MT_TRANS phrase="StyleCatcher lets you easily browse through styles and then apply them to your blog in just a few clicks. To find out more about Movable Type styles, or for new sources for styles, visit the <a href='http://www.sixapart.com/movabletype/styles'>Movable Type styles</a> page."> 
    399          <TMPL_IF NAME=CONFIG_LINK><MT_TRANS phrase=" To change the location of your local theme repository, <a href='<TMPL_VAR NAME=CONFIG_LINK>'> click here."></a></TMPL_IF></p> 
    400  
    401            <script type="text/javascript"> 
    402            if(navigator.userAgent.indexOf("Firefox")!=-1){ 
    403            var versionindex=navigator.userAgent.indexOf("Firefox")+8 
    404               document.writeln("<p><MT_TRANS phrase="Install <a href='http://greasemonkey.mozdev.org/'>GreaseMonkey</a>"> <a href='<TMPL_VAR NAME=SCRIPT_URL>?__mode=gm<TMPL_IF NAME=BLOG_ID>&amp;blog_id=<TMPL_VAR NAME=BLOG_ID></TMPL_IF>;file=stylecatcher.user.js'><MT_TRANS phrase="StyleCatcher user script."></a></p>"); 
    405            } 
    406            </script> 
    407  
    408            <form method="get" action="<TMPL_VAR NAME=SCRIPT_URL>"> 
    409               <strong><MT_TRANS phrase="Theme or Repository URL:"></strong> 
    410               <input class="repo-url" style="width:350px;" name="url" id="repo-url" value="<TMPL_VAR NAME=LAST_THEME_URL>" /> 
    411               <input type="button" id="find-button" value="<MT_TRANS phrase="Find Styles">" onclick="getStyles()" /> 
    412            </form> 
    413             <p><strong><MT_TRANS phrase="NOTE:"></strong> <MT_TRANS phrase="It will take a moment for themes to populate once you click 'Find Style'."></p>  
    414             <p id="status-message" class="message" style="display: none"></p> 
    415              
    416             <div id="template-picker"> 
    417                 <div id="categories-wrapper"> 
    418                     <h2><MT_TRANS phrase="Categories"></h2> 
    419                     <div class="scrollbox" id="categories"> 
    420 <TMPL_IF NAME=SINGLE_BLOG> 
    421                         <div class="category" id="category-current" title="<MT_TRANS phrase="Current theme for your weblog">" style="display: none"><img src="<TMPL_VAR NAME=PLUGIN_STATIC_URI>images/top-rated.gif" alt="Your Current Theme" /><span><MT_TRANS phrase="Current Theme"></span> 
    422 <TMPL_ELSE> 
    423                         <div class="category" id="category-current" title="<MT_TRANS phrase="Current themes for your weblogs">" style="display: none"><img src="<TMPL_VAR NAME=PLUGIN_STATIC_URI>images/top-rated.gif" alt="Your Current Themes" /><span><MT_TRANS phrase="Current Themes"></span> 
    424 </TMPL_IF> 
    425                         </div> 
    426                         <div class="category" id="category-my-designs" title="<MT_TRANS phrase="Locally saved themes">" style="display: none"><img src="<TMPL_VAR NAME=PLUGIN_STATIC_URI>images/my-designs.gif" alt="my-designs" /><span><MT_TRANS phrase="Saved Themes"></span> 
    427                         </div> 
    428                         <div class="category" id="category-more" title="<MT_TRANS phrase="Single themes from the web">" style="display: none"><img src="<TMPL_VAR NAME=PLUGIN_STATIC_URI>images/featured.gif" alt="my-designs" /><span><MT_TRANS phrase="More Themes"></span> 
    429                         </div> 
    430                     </div> 
    431                 </div> 
    432  
    433                 <div id="templates-wrapper"> 
    434                     <h2 id="selected-category-title"><MT_TRANS phrase="Templates"></h2> 
    435                     <div class="scrollbox" id="display-current" style="display: none;"></div> 
    436                     <div class="scrollbox" id="display-my-designs" style="display: none;"></div> 
    437                     <div class="scrollbox" id="display-more" style="display: none;"></div> 
    438                 </div> 
    439  
    440                 <div id="details-wrapper" style="display: none"> 
    441                     <h2><MT_TRANS phrase="Details"></h2> 
    442                     <div id="display-details"> 
    443                         <div class="tc-mixer-entry"></div> 
    444                     </div> 
    445                 </div> 
    446  
    447                 <a id="show-details" href="javascript:void(0);" onclick="return showDetails( true );" style="display: none"><MT_TRANS phrase="Show Details"></a> 
    448                 <a id="hide-details" href="javascript:void(0);" onclick="return showDetails( false );" style="display: none"><MT_TRANS phrase="Hide Details"></a> 
     467                } 
     468            } else { 
     469                mixer.addEntries(themes[i]); 
     470            } 
     471        } 
     472        mixer.display(); 
     473    } 
     474 
     475    function downloadStyles() { 
     476        var url; 
     477        if (url = prompt("<__trans phrase="Stylesheet or Repository URL" escape="js">")) { 
     478            getStyles(null, url); 
     479        } 
     480    } 
     481 
     482    function getStyles(repo_id, url) { 
     483        var btn = getByID("find-button"); 
     484        TC.addClassName(btn, "hidden"); 
     485        TC.removeClassName(TC.elementOrId("loading-styles"), "hidden"); 
     486 
     487        var client = TC.Client.call({ 
     488            'load': function(c,s) { stylesLoaded(c,s,repo_id) }, 
     489            'uri': '<mt:var name="script_url">', 
     490            'method': 'POST', 
     491            'arguments': { 
     492                '__mode': 'stylecatcher_js', 
     493                'url': url 
     494            } 
     495        }); 
     496    } 
     497/* ]]> */ 
     498</script> 
     499<!-- end stylecatcher script section --> 
     500</mt:setvarblock> 
     501<mt:include name="include/header.tmpl"> 
     502 
     503<div id="msg-block"> 
     504</div> 
     505 
     506<div id="wrapper"> 
     507 
     508<!-- 
     509<form method="get" action="<mt:var name="script_url">"> 
     510    <strong><__trans phrase="Stylesheet or Repository URL:"></strong> 
     511    <input class="repo-url" style="width:350px;" name="url" id="repo-url" value="<mt:var name="last_theme_url">" /> 
     512    <input type="button" id="find-button" value="<__trans phrase="Download Styles">" onclick="getStyles()" /> 
     513    <span class="hidden" id="loading-styles"> 
     514        <img src="<mt:var name="static_uri">images/indicator.white.gif" height="16" width="16" alt="" /> 
     515        <__trans phrase="Loading..."> 
     516    </span> 
     517</form> 
     518--> 
     519 
     520<p id="status-message" class="message" style="display: none"></p> 
     521 
     522<div id="template-picker"> 
     523    <div id="categories-wrapper"> 
     524 
     525        <h2> 
     526            <span style="float:right"> 
     527                <a href="javascript:void(0)" id="find-button" onclick="return downloadStyles()" class="icon-right icon-create" title="Download new styles">&nbsp;</a> 
     528 
     529            <span class="hidden" id="loading-styles"> 
     530                <img src="<mt:var name="static_uri">images/indicator.white.gif" height="16" width="16" alt="" /> 
     531            </span> 
     532 
     533            </span> 
     534 
     535            <__trans phrase="Categories"> 
     536        </h2> 
     537 
     538        <div class="scrollbox" id="categories"> 
     539            <div class="category" id="category-current" title="<__trans phrase="Current theme for your weblog">" style="display: none"><img src="<mt:var name="plugin_static_uri">images/top-rated.gif" alt="Your Current Style" /><span><__trans phrase="Current Style"></span> 
    449540            </div> 
    450              
    451             <br class="clr" /> 
    452  
    453             <div id="select-design-controls"> 
    454 <TMPL_UNLESS NAME=SINGLE_BLOG> 
    455             <select name="blog_id" id="select-blog"> 
    456             <option value=""><MT_TRANS phrase="Select a Weblog..."></option> 
    457             <TMPL_LOOP NAME=BLOG_LOOP> 
    458             <option value="<TMPL_VAR NAME=BLOG_ID>"><TMPL_VAR NAME=BLOG_NAME></option> 
    459             </TMPL_LOOP> 
    460             </select> 
    461 </TMPL_UNLESS> 
    462  
    463             <input type="button" name="choose" id="apply-button" onclick="applyDesign()" value="<MT_TRANS phrase="Apply Selected Design">" /> 
     541            <div class="category" id="category-my-designs" title="<__trans phrase="Locally saved themes">" style="display: none"><img src="<mt:var name="plugin_static_uri">images/my-designs.gif" alt="my-designs" /><span><__trans phrase="Saved Styles"></span> 
    464542            </div> 
    465             <br class="clr" /> 
     543            <div class="category" id="category-mt-designs" title="<__trans phrase="Default Styles">" style="display: none"><img src="<mt:var name="plugin_static_uri">images/gear.gif" alt="mt-designs" /><span><__trans phrase="Default Styles"></span> 
     544            </div> 
     545            <div class="category" id="category-more" title="<__trans phrase="Single themes from the web">" style="display: none"><img src="<mt:var name="plugin_static_uri">images/featured.gif" alt="my-designs" /><span><__trans phrase="More Styles"></span> 
     546            </div> 
     547            <mt:loop name="style_library"> 
     548            <div class="category" id="category-repo-<mt:var name="key">" title="<mt:var name="description_label" escape="html">"><img src="<mt:var name="plugin_static_uri">images/featured.gif" alt="more-designs" /><span><mt:var name="label"></span> 
     549            </div> 
     550            </mt:loop> 
    466551        </div> 
    467  
    468 <TMPL_ELSE> 
    469  
    470 <p class="message"> 
    471 <MT_TRANS phrase="You don't appear to have any weblogs with a 'styles-site.css' template that you have rights to edit. Please check your weblog(s) for this template."> 
    472 </p> 
    473  
    474 </TMPL_IF> 
    475  
    476 <TMPL_INCLUDE NAME="footer.tmpl"> 
     552    </div> 
     553 
     554    <div id="templates-wrapper"> 
     555        <h2 id="selected-category-title"><__trans phrase="Templates"></h2> 
     556        <div class="scrollbox" id="display-current" style="display: none;"></div> 
     557        <div class="scrollbox" id="display-my-designs" style="display: none;"></div> 
     558        <div class="scrollbox" id="display-mt-designs" style="display: none;"></div> 
     559        <div class="scrollbox" id="display-more" style="display: none;"></div> 
     560        <mt:loop name="style_library"> 
     561        <div class="scrollbox" id="display-repo-<mt:var name="key">" style="display: none;"></div> 
     562        </mt:loop> 
     563    </div> 
     564 
     565    <div id="details-wrapper"> 
     566        <h2><__trans phrase="Selected Design"></h2> 
     567        <div id="display-details"> 
     568        <div id="select-design-controls" class="actions-bar"> 
     569            <form method="get" action=""> 
     570                <p> 
     571                    <label for="layout-list"><__trans phrase="Layout">:</label> 
     572                    <select id="layout-list" onchange="updateApplyButton()"> 
     573                    </select> 
     574                </p> 
     575 
     576                <span class="button-actions actions"> 
     577                <button 
     578                    type="button" 
     579                    accesskey="s" 
     580                    id="apply-button" 
     581                    title="<__trans phrase="Apply Design"> (s)" 
     582                    onclick="applyDesign()" 
     583                    class="primary-button"><__trans phrase="Apply Design"></button> 
     584                </span> 
     585            </form> 
     586        </div> 
     587 
     588        <div id="display-details-content"></div> 
     589 
     590 
     591    </div> 
     592 
     593</div> 
     594 
     595<br class="clr" /> 
     596 
     597</div> 
     598 
     599<mt:include name="include/footer.tmpl">