Changesets can be listed by changeset number.
The Git repository is here.
- Revision:
- 381
- Log:
Radiant is now packaged as a Gem - see Changeset #373, Changeset #374,
Changeset #375, Changeset #376, Changeset #377, Changeset #378,
Changeset #379 and Changeset #380. The application part of Radiant is
now mostly empty; it exists to provide a structure which hooks into the
gem and which provides a framework for extensions. Included in this big
changeset are all the deletions, additions and changes needed to go from
the old ROOL customised Radiant to a new ROOL customised Radiant, which
includes several custom extensions adapted from the old Radiant
modifications and requires Radiant 0.9.1 to be installed as a gem.
- Author:
- rool
- Date:
- Mon Mar 21 14:01:18 +0000 2011
- Size:
- 1501 Bytes
1 | // String extensions |
2 | Object.extend(String.prototype, { |
3 | upcase: function() { |
4 | return this.toUpperCase(); |
5 | }, |
6 | |
7 | downcase: function() { |
8 | return this.toLowerCase(); |
9 | }, |
10 | |
11 | toInteger: function() { |
12 | return parseInt(this); |
13 | }, |
14 | |
15 | toSlug: function() { |
16 | return this.strip().downcase().replace(/[^-a-z0-9~\s\.:;+=_]/g, '').replace(/[\s\.:;=+]+/g, '-'); |
17 | } |
18 | }); |
19 | |
20 | // Element extensions |
21 | Element.addMethods({ |
22 | hasWord: function(element, word) { |
23 | element = $(element); |
24 | if (element.nodeType == Node.TEXT_NODE) { |
25 | return element.nodeValue.include(word); |
26 | } else { |
27 | return $A(element.childNodes).any(function(child) { |
28 | return Element.hasWord(child, word); |
29 | }); |
30 | } |
31 | }, |
32 | |
33 | centerInViewport: function(element) { |
34 | var header = $('header') |
35 | var headerBottom = header.getHeight(); |
36 | var viewport = document.viewport.getScrollOffsets(); |
37 | viewport.height = document.viewport.getHeight(); |
38 | viewport.width = document.viewport.getWidth(); |
39 | viewport.bottom = viewport.top + viewport.height; |
40 | viewport.top = Math.max(viewport.top, headerBottom); |
41 | viewport.height = viewport.bottom - viewport.top; |
42 | element.style.position = 'absolute'; |
43 | element.style.top = (viewport.top + (viewport.height - element.getHeight()) / 2.5) + 'px'; |
44 | element.style.left = (viewport.left + (viewport.width - element.getWidth()) / 2) + 'px'; |
45 | } |
46 | }); |
47 | |
48 | Popup.AbstractWindow.addMethods({ |
49 | centerWindowInView: function() { |
50 | this.element.centerInViewport(); |
51 | } |
52 | }); |