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
Click here to lend your support to: mephisto and make a donation at www.pledgie.com !
add Mephisto.root javascript variable in case a mephisto site sets the 
relative_url_root

git-svn-id: http://svn.techno-weenie.net/projects/mephisto/trunk@2491 
567b1171-46fb-0310-a4c9-b4bef9110e78
technoweenie (author)
Wed Nov 22 08:07:25 -0800 2006
commit  45212feeb2159209190c20c6ff26712607df1992
tree    d0e4659c8b28f0b81e7b7422c9733ec5f236e03c
parent  074a752d003e8b6cf3282b2a4186f7a913d358f4
...
1
2
 
 
 
 
3
4
5
...
1
2
3
4
5
6
7
8
9
0
@@ -1,5 +1,9 @@
0
 * SVN *
0
 
0
+* add Mephisto.root javascript variable in case a mephisto site sets the relative_url_root
0
+
0
+* Allow Modules to use #include_into to dynamically mixin to loaded classes (plugin stuff)
0
+
0
 * Allow custom routes.
0
 
0
   Mephisto::Routing.connect_with map do
...
6
7
8
 
9
10
11
...
6
7
8
9
10
11
12
0
@@ -6,6 +6,7 @@
0
     <title><%= site.title %>: Admin <%= controller.controller_name %></title>
0
     <%= stylesheet_link_tag 'mephisto/mephisto' %>
0
     <%= javascript_include_tag 'mephisto/prototype', 'mephisto/effects', 'mephisto/dragdrop', 'mephisto/lowpro', 'mephisto/application' %>
0
+ <script type="text/javascript">Mephisto.root = '<%= ActionController::AbstractRequest.relative_url_root %>';</script>
0
     <%= yield :head %>
0
   </head>
0
   <body>
...
6
7
8
 
9
10
11
...
6
7
8
9
10
11
12
0
@@ -6,6 +6,7 @@
0
     <title>Mephisto: <%= controller.controller_name %> Admin</title>
0
     <%= stylesheet_link_tag 'mephisto/fullscreen' %>
0
     <%= javascript_include_tag 'mephisto/prototype', 'mephisto/effects', 'mephisto/lowpro', 'mephisto/application' %>
0
+ <script type="text/javascript">Mephisto.root = '<%= ActionController::AbstractRequest.relative_url_root %>';</script>
0
   </head>
0
   <body id="body-<%= controller.controller_name %>">
0
   
...
152
153
154
155
 
156
157
158
159
160
 
161
162
163
...
206
207
208
209
210
211
 
212
213
214
...
299
300
301
302
 
303
304
305
...
314
315
316
317
 
318
319
320
321
 
322
323
324
...
348
349
350
351
 
352
353
354
...
511
512
513
 
514
515
516
...
553
554
555
556
 
557
558
559
...
152
153
154
 
155
156
157
158
159
 
160
161
162
163
...
206
207
208
 
209
 
210
211
212
213
...
298
299
300
 
301
302
303
304
...
313
314
315
 
316
317
318
319
 
320
321
322
323
...
347
348
349
 
350
351
352
353
...
510
511
512
513
514
515
516
...
553
554
555
 
556
557
558
559
0
@@ -152,12 +152,12 @@ var TinyTab = Class.create();
0
 TinyTab.callbacks ={
0
   'latest-files': function() {
0
     if($('latest-assets').childNodes.length == 0)
0
- new Ajax.Request('/admin/assets;latest');
0
+ new Ajax.Request(Mephisto.root + '/admin/assets;latest');
0
   },
0
   'search-files': function(q) {
0
     if(!q) return;
0
     $('spinner').show();
0
- new Ajax.Request('/admin/assets;search', {parameters: 'q=' + escape(q)});
0
+ new Ajax.Request(Mephisto.root + '/admin/assets;search', {parameters: 'q=' + escape(q)});
0
   }
0
 };
0
 
0
@@ -206,9 +206,8 @@ TinyTab.prototype = {
0
 Asset = {
0
   upload: function(form) {
0
     form = $(form);
0
- '/admin/articles/edit/105'
0
     article_id = location.href.match(/\/edit\/([0-9]+)/);
0
- form.action = "/admin/articles/upload"
0
+ form.action = Mephisto.root + "/admin/articles/upload"
0
     if(article_id) form.action += "/" + article_id[1]
0
     form.submit();
0
   },
0
@@ -299,7 +298,7 @@ var ArticleForm = {
0
   
0
   getRevision: function() {
0
     var rev = $F(this)
0
- var url = '/admin/articles/edit/' + location.href.match(/\/edit\/([0-9]+)/)[1];
0
+ var url = Mephisto.root + '/admin/articles/edit/' + location.href.match(/\/edit\/([0-9]+)/)[1];
0
     if(rev != '0') url += "/" + rev;
0
     location.href = url;
0
   }
0
@@ -314,11 +313,11 @@ Comments = {
0
 var UserForm = {
0
   toggle: function(chk) {
0
     $('user-' + chk.getAttribute('value') + '-progress').show();
0
- new Ajax.Request('/admin/users/' + (chk.checked ? 'enable' : 'destroy') + '/' + chk.getAttribute('value'));
0
+ new Ajax.Request(Mephisto.root + '/admin/users/' + (chk.checked ? 'enable' : 'destroy') + '/' + chk.getAttribute('value'));
0
   },
0
   toggleAdmin: function(chk) {
0
     $('user-' + chk.getAttribute('value') + '-progress').show();
0
- new Ajax.Request('/admin/users/admin/' + chk.getAttribute('value'));
0
+ new Ajax.Request(Mephisto.root + '/admin/users/admin/' + chk.getAttribute('value'));
0
   }
0
 }
0
 
0
@@ -348,7 +347,7 @@ var SectionForm = {
0
       qu.push('sorted_ids[]=' + li.getAttribute('id').substr(container_id.length));
0
       return qu;
0
     }).join('&')
0
- new Ajax.Request('/admin/sections/order/' + section_id, {asynchronous:true, evalScripts:true, parameters:query});
0
+ new Ajax.Request(Mephisto.root + '/admin/sections/order/' + section_id, {asynchronous:true, evalScripts:true, parameters:query});
0
   }
0
 }
0
 
0
@@ -511,6 +510,7 @@ ToolBox.prototype = {
0
   }
0
 }
0
 
0
+var Mephisto = { root: ''; }
0
 
0
 Effect.DefaultOptions.duration = 0.25;
0
 Event.addBehavior({
0
@@ -553,7 +553,7 @@ Event.addBehavior({
0
     var img = this.down('img');
0
     var pieces = img.src.split('/');
0
     new Dialog.Rjs();
0
- new Ajax.Request('/admin/themes/show/' + pieces[pieces.length-1]);
0
+ new Ajax.Request(Mephisto.root + '/admin/themes/show/' + pieces[pieces.length-1]);
0
   }
0
   
0
   //'.theme': function() {

Comments

    No one has commented yet.