public
Fork of halorgium/mephisto
Description: A mirror of the mephisto code-base
Homepage: http://mephistoblog.com/
Clone URL: git://github.com/technoweenie/mephisto.git
Search Repo:
Click here to lend your support to: mephisto and make a donation at www.pledgie.com !
Added basic theme interface.  Will change in the future

git-svn-id: http://svn.techno-weenie.net/projects/mephisto/trunk@2211 
567b1171-46fb-0310-a4c9-b4bef9110e78
Caged (author)
Mon Sep 18 16:50:59 -0700 2006
commit  9b7d905bdf636f720a1bb43ef4158189cefae97b
tree    eb24072ad13ecfeb199fc8d073a548b3d4101d1a
parent  79943b8c0199d594f3455dca87979345b1ef5d7f
...
 
 
 
 
 
 
 
 
...
1
2
3
4
5
6
7
8
0
@@ -1 +1,9 @@
0
+class Admin::ThemesController < Admin::BaseController
0
+
0
+ def index
0
+ end
0
+
0
+ def import
0
+ end
0
+end
...
 
 
...
1
2
0
@@ -1 +1,3 @@
0
+module Admin::ThemesHelper
0
+end
...
2
3
4
 
5
6
7
...
2
3
4
5
6
7
8
0
@@ -2,6 +2,7 @@
0
   <div id="page-nav">
0
     <ul id="act-nav" class="clear">
0
       <li><%= link_to "New template", :controller => 'design' %></li>
0
+ <li><%= link_to "Manage themes", :controller => 'themes' %></li>
0
     </ul>
0
   </div>
0
 <% end %>
...
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
0
@@ -1 +1,28 @@
0
+<% content_for :action_nav do %>
0
+ <div id="page-nav">
0
+ <ul id="act-nav" class="clear">
0
+ <li><%= link_to "View themes", :controller => 'themes' %></li>
0
+ <li><%= link_to "Edit templates", :controller => 'templates' %></li>
0
+ </ul>
0
+ </div>
0
+<% end %>
0
+
0
+<div class="group">
0
+ <dl>
0
+ <dt>
0
+ <label for="theme_name">Import a new theme</label>
0
+ <p class="hint">
0
+ Themes are packaged as zip files. Please select a valid zip file from your hard drive to upload.
0
+ If you're interested in finding more themes, or have a new theme you'd like to release, please visit
0
+ <a href="http://mephisto.stikipad.com/help/show/Custom+Templates">the theme page</a> on the Mephisto Wiki.
0
+ </p>
0
+ <p class="hint">When you upload a theme, it will not be applied automatically. You will need to do this through the <%= link_to 'themes interface', :controller => 'themes' %>.</p>
0
+ </dt>
0
+ <dd><input type="file" /></dd>
0
+ </dl>
0
+</div>
0
+<p class="btns">
0
+ <%= submit_tag 'Import theme' %> or
0
+ <%= link_to 'cancel', :controller => 'themes' %>
0
+</p>
...
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
0
@@ -1 +1,81 @@
0
+<% content_for :action_nav do %>
0
+ <div id="page-nav">
0
+ <ul id="act-nav" class="clear">
0
+ <li><%= link_to "Import new theme", :controller => 'themes', :action => 'import' %></li>
0
+ </ul>
0
+ </div>
0
+<% end %>
0
+
0
+<div id="themes">
0
+ <ul id="themelist">
0
+ <li class="theme">
0
+ <h3>
0
+ A nice theme
0
+ <span class="thememeta">
0
+ v0.5 | by Dude Yo
0
+ </span>
0
+ </h3>
0
+ <img src="/images/mephisto/preview.png" alt="Theme preview" title="A nice theme (v0.5)" />
0
+ <div class="tools" style="display:none">
0
+ <ul>
0
+ <li><a href="#" title="title">Use this theme</a></li>
0
+ <li><a href="#" title="title">Edit source code</a></li>
0
+ <li><a href="#" title="title">Change info</a></li>
0
+ <li><a href="#" title="title">Export</a></li>
0
+ </ul>
0
+ </div>
0
+ </li>
0
+ <li class="theme" id="inuse">
0
+ <h3>
0
+ A nice theme
0
+ <span class="thememeta">
0
+ v0.5 | by Dude Yo
0
+ </span>
0
+ </h3>
0
+ <img src="/images/mephisto/preview.png" alt="Theme preview" title="A nice theme (v0.5)" />
0
+ <div class="tools" style="display:none">
0
+ <ul>
0
+ <li><a href="#" title="title">Use this theme</a></li>
0
+ <li><a href="#" title="title">Edit source code</a></li>
0
+ <li><a href="#" title="title">Change info</a></li>
0
+ <li><a href="#" title="title">Export</a></li>
0
+ </ul>
0
+ </div>
0
+ </li>
0
+ <li class="theme">
0
+ <h3>
0
+ A nice theme
0
+ <span class="thememeta">
0
+ v0.5 | by Dude Yo
0
+ </span>
0
+ </h3>
0
+ <img src="/images/mephisto/preview.png" alt="Theme preview" title="A nice theme (v0.5)" />
0
+ <div class="tools" style="display:none">
0
+ <ul>
0
+ <li><a href="#" title="title">Use this theme</a></li>
0
+ <li><a href="#" title="title">Edit source code</a></li>
0
+ <li><a href="#" title="title">Change info</a></li>
0
+ <li><a href="#" title="title">Export</a></li>
0
+ </ul>
0
+ </div>
0
+ </li>
0
+ <li class="theme">
0
+ <h3>
0
+ A nice theme
0
+ <span class="thememeta">
0
+ v0.5 | by Dude Yo
0
+ </span>
0
+ </h3>
0
+ <img src="/images/mephisto/preview.png" alt="Theme preview" title="A nice theme (v0.5)" />
0
+ <div class="tools" style="display:none">
0
+ <ul>
0
+ <li><a href="#" title="title">Use this theme</a></li>
0
+ <li><a href="#" title="title">Edit source code</a></li>
0
+ <li><a href="#" title="title">Change info</a></li>
0
+ <li><a href="#" title="title">Export</a></li>
0
+ </ul>
0
+ </div>
0
+ </li>
0
+ </ul>
0
+</div>
...
456
457
458
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
459
460
461
...
475
476
477
 
 
 
 
 
478
479
480
...
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
...
533
534
535
536
537
538
539
540
541
542
543
0
@@ -456,6 +456,64 @@
0
   }
0
 }
0
 
0
+
0
+ToolBox = Class.create();
0
+ToolBox.current = null;
0
+ToolBox.prototype = {
0
+ initialize: function(element) {
0
+ this.toolbox = $(element);
0
+ if(!this.toolbox) return;
0
+ this.timeout = null;
0
+ this.tools = this.findTools();
0
+
0
+ Event.observe(this.toolbox, 'mouseover', this.onHover.bindAsEventListener(this), true);
0
+ Event.observe(this.toolbox, 'mouseout', this.onBlur.bindAsEventListener(this), true);
0
+ Event.observe(this.tools, 'mouseover', this.onHover.bindAsEventListener(this));
0
+ Event.observe(this.tools, 'mouseout', this.onBlur.bindAsEventListener(this));
0
+ },
0
+
0
+ show: function() {
0
+ if(this.timeout) {
0
+ clearTimeout(this.timeout);
0
+ this.timeout = null;
0
+ }
0
+
0
+ if(ToolBox.current) {
0
+ ToolBox.current.hideTools();
0
+ }
0
+
0
+ if(this.tools) {
0
+ Element.show(this.tools);
0
+ ToolBox.current = this;
0
+ }
0
+ },
0
+
0
+ onHover: function(event) {
0
+ this.show();
0
+ },
0
+
0
+ onBlur: function(event) {
0
+ this.considerHidingTools();
0
+ },
0
+
0
+ considerHidingTools: function() {
0
+ if(this.timeout) { clearTimeout(this.timeout); }
0
+ this.timeout = setTimeout(this.hideTools.bind(this), 500);
0
+ },
0
+
0
+ hideTools: function() {
0
+ clearTimeout(this.timeout);
0
+ this.timeout = null;
0
+ Element.hide(this.tools);
0
+ },
0
+
0
+ findTools: function() {
0
+ var tools = document.getElementsByClassName('tools', this.toolbox)[0];
0
+ if(!tools) { throw "You called new ToolBox() on an element which has no class=\"tools\" child element"; }
0
+ return tools;
0
+ }
0
+}
0
+
0
 Effect.DefaultOptions.duration = 0.25;
0
 Event.addBehavior({
0
   '#filesearch': function() { window.spotlight = new Spotlight('filesearchform', 'filesearch'); },
0
@@ -475,6 +533,11 @@
0
   '#searchsubmit:click': function() {
0
     $('published').value = '0';
0
     $('article-search').submit();
0
+ },
0
+
0
+ '.theme': function() {
0
+ console.log(this);
0
+ new ToolBox(this);
0
   }
0
 });
0
 
...
1398
1399
1400
1401
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1402
1403
 
1404
 
1405
1406
1407
...
1495
1496
1497
1498
1499
1500
1501
...
1398
1399
1400
 
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
 
1479
1480
1481
1482
1483
1484
...
1572
1573
1574
 
1575
1576
1577
0
@@ -1398,10 +1398,87 @@
0
 .file-tools li.fdelete a { background-image: url(/images/mephisto/icons/8-em-cross.png) }
0
 .pdf { width: 100px; height: 100px;}
0
 .fspin img { position: absolute; left: 40%; top: 40%;}
0
-/*
0
+
0
+
0
+/*------------------------------------------------------------------------
0
+ *=THEMES
0
+ ------------------------------------------------------------------------*/
0
+#themelist {
0
+ list-style: none;
0
+}
0
+
0
+#themelist li {
0
+ display: block;
0
+ float: left;
0
+ width: 30%;
0
+ position: relative;
0
+}
0
+
0
+#themelist ul li {
0
+ float: none;
0
+}
0
+
0
+.theme {
0
+ margin-bottom: 20px;
0
+ text-align: center;
0
+ padding: 5px 5px 20px 5px;
0
+ border-bottom: 1px dotted #ccc;
0
+}
0
+
0
+#themelist img {
0
+ width: 125px;
0
+ height: 125px;
0
+ background: #fff;
0
+ padding: 3px;
0
+ border: 2px solid #aaa;
0
+}
0
+
0
+.thememeta {
0
+ display: block;
0
+ font-weight: normal;
0
+ font-size: 90%;
0
+ color: #777;
0
+}
0
+
0
+#themelist .tools {
0
+ position: absolute;
0
+ bottom: -100px;
0
+ left: 30%;
0
+ text-align: left;
0
+ z-index: 9999;
0
+ padding: 0 3px 3px 0;
0
+ width: 150px;
0
+ background: url(/images/mephisto/shadow.png) bottom right no-repeat;
0
+}
0
+
0
+#themelist .tools ul {
0
+ border: 4px solid #fff;
0
+ background: #eee;
0
+}
0
+
0
+#themelist .tools a {
0
+ display: block;
0
+ border-bottom: 1px solid #fff;
0
+ padding: 5px;
0
+ width: 130px;
0
+ color: #555;
0
+}
0
+
0
+#themelist .tools a:hover {
0
+ color: #333;
0
+}
0
+
0
+#inuse img {
0
+ background: #eff;
0
+ border: 2px solid #7bb;
0
+}
0
+
0
+
0
+/*------------------------------------------------------------------------
0
  *=MISC
0
- */
0
+ ------------------------------------------------------------------------*/
0
 
0
+
0
 cite {
0
   font-style: normal;
0
 }
0
@@ -1495,7 +1572,6 @@
0
   width: 25px;
0
   text-indent: -99999px;
0
 }
0
-
0
 
0
 
0
 
...
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
0
@@ -1 +1,19 @@
0
+require File.dirname(__FILE__) + '/../../test_helper'
0
+require 'admin/themes_controller'
0
+
0
+# Re-raise errors caught by the controller.
0
+class Admin::ThemesController; def rescue_action(e) raise e end; end
0
+
0
+class Admin::ThemesControllerTest < Test::Unit::TestCase
0
+ def setup
0
+ @controller = Admin::ThemesController.new
0
+ @request = ActionController::TestRequest.new
0
+ @response = ActionController::TestResponse.new
0
+ end
0
+
0
+ # Replace this with your real tests.
0
+ def test_truth
0
+ assert true
0
+ end
0
+end

Comments

    No one has commented yet.