/[drupal]/contributions/modules/block_edit/block_edit.js
ViewVC logotype

Contents of /contributions/modules/block_edit/block_edit.js

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.2 - (show annotations) (download) (as text)
Wed Oct 22 05:31:04 2008 UTC (13 months ago) by inadarei
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +13 -9 lines
File MIME type: text/javascript
fixing javascript problems
1 /*
2 Copyright (C) 2008 by Phase2 Technology.
3 Author: Irakli Nadareishvili
4
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License.
7 This program is distributed in the hope that it will be useful,
8 but WITHOUT ANY WARRANTY. See the LICENSE.txt file for more details.
9
10 */
11
12 $(document).ready(function(){
13
14 var regexp = new RegExp(/block-(.+?)-(.+?)/mi);
15 var checkp = new RegExp(/block-.*?-.+/mi);
16
17 $("div.block").each(function (i) {
18 var block_id = $(this).attr('id');
19 if (block_id.match(checkp)) {
20 var block_path = block_id.replace(regexp, '$1/$2');
21 block_id = block_id.replace(regexp, '$1_$2');
22 var block_link = '<div id="bel_id_' + block_id + '" class="block_edit_link"><a href="/admin/build/block/configure/' + block_path + '">Edit</a></div>';
23 $(this).prepend(block_link);
24 }
25 });
26
27 $("div.block").mouseover(function(){
28 var block_id = $(this).attr('id');
29 if (block_id.match(checkp)) {
30 block_id = block_id.replace(regexp, '$1_$2');
31 $('div#bel_id_'+block_id).css('display', 'block');
32 }
33 });
34
35 $("div.block").mouseout(function(){
36 var block_id = $(this).attr('id');
37 if (block_id.match(checkp)) {
38 block_id = block_id.replace(regexp, '$1_$2');
39 $('div#bel_id_'+block_id).css('display', 'none');
40 }
41 });
42
43 });

  ViewVC Help
Powered by ViewVC 1.1.2