You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@archiva.apache.org by ol...@apache.org on 2012/02/27 20:28:38 UTC

svn commit: r1294292 - in /archiva/site/src/site: resources/js/bootstrap-dropdown.1.4.0.js resources/js/bootstrap-modal.1.4.0.js resources/js/index.js xdoc/index.xml.vm

Author: olamy
Date: Mon Feb 27 19:28:38 2012
New Revision: 1294292

URL: http://svn.apache.org/viewvc?rev=1294292&view=rev
Log:
use modal from bootsrap

Added:
    archiva/site/src/site/resources/js/bootstrap-dropdown.1.4.0.js   (with props)
    archiva/site/src/site/resources/js/bootstrap-modal.1.4.0.js   (with props)
Modified:
    archiva/site/src/site/resources/js/index.js
    archiva/site/src/site/xdoc/index.xml.vm

Added: archiva/site/src/site/resources/js/bootstrap-dropdown.1.4.0.js
URL: http://svn.apache.org/viewvc/archiva/site/src/site/resources/js/bootstrap-dropdown.1.4.0.js?rev=1294292&view=auto
==============================================================================
--- archiva/site/src/site/resources/js/bootstrap-dropdown.1.4.0.js (added)
+++ archiva/site/src/site/resources/js/bootstrap-dropdown.1.4.0.js Mon Feb 27 19:28:38 2012
@@ -0,0 +1,55 @@
+/* ============================================================
+ * bootstrap-dropdown.js v1.4.0
+ * http://twitter.github.com/bootstrap/javascript.html#dropdown
+ * ============================================================
+ * Copyright 2011 Twitter, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============================================================ */
+
+
+!function( $ ){
+
+  "use strict"
+
+  /* DROPDOWN PLUGIN DEFINITION
+   * ========================== */
+
+  $.fn.dropdown = function ( selector ) {
+    return this.each(function () {
+      $(this).delegate(selector || d, 'click', function (e) {
+        var li = $(this).parent('li')
+          , isActive = li.hasClass('open')
+
+        clearMenus()
+        !isActive && li.toggleClass('open')
+        return false
+      })
+    })
+  }
+
+  /* APPLY TO STANDARD DROPDOWN ELEMENTS
+   * =================================== */
+
+  var d = 'a.menu, .dropdown-toggle'
+
+  function clearMenus() {
+    $(d).parent('li').removeClass('open')
+  }
+
+  $(function () {
+    $('html').bind("click", clearMenus)
+    $('body').dropdown( '[data-dropdown] a.menu, [data-dropdown] .dropdown-toggle' )
+  })
+
+}( window.jQuery || window.ender );

Propchange: archiva/site/src/site/resources/js/bootstrap-dropdown.1.4.0.js
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: archiva/site/src/site/resources/js/bootstrap-dropdown.1.4.0.js
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: archiva/site/src/site/resources/js/bootstrap-modal.1.4.0.js
URL: http://svn.apache.org/viewvc/archiva/site/src/site/resources/js/bootstrap-modal.1.4.0.js?rev=1294292&view=auto
==============================================================================
--- archiva/site/src/site/resources/js/bootstrap-modal.1.4.0.js (added)
+++ archiva/site/src/site/resources/js/bootstrap-modal.1.4.0.js Mon Feb 27 19:28:38 2012
@@ -0,0 +1,260 @@
+/* =========================================================
+ * bootstrap-modal.js v1.4.0
+ * http://twitter.github.com/bootstrap/javascript.html#modal
+ * =========================================================
+ * Copyright 2011 Twitter, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ========================================================= */
+
+
+!function( $ ){
+
+  "use strict"
+
+ /* CSS TRANSITION SUPPORT (https://gist.github.com/373874)
+  * ======================================================= */
+
+  var transitionEnd
+
+  $(document).ready(function () {
+
+    $.support.transition = (function () {
+      var thisBody = document.body || document.documentElement
+        , thisStyle = thisBody.style
+        , support = thisStyle.transition !== undefined || thisStyle.WebkitTransition !== undefined || thisStyle.MozTransition !== undefined || thisStyle.MsTransition !== undefined || thisStyle.OTransition !== undefined
+      return support
+    })()
+
+    // set CSS transition event type
+    if ( $.support.transition ) {
+      transitionEnd = "TransitionEnd"
+      if ( $.browser.webkit ) {
+      	transitionEnd = "webkitTransitionEnd"
+      } else if ( $.browser.mozilla ) {
+      	transitionEnd = "transitionend"
+      } else if ( $.browser.opera ) {
+      	transitionEnd = "oTransitionEnd"
+      }
+    }
+
+  })
+
+
+ /* MODAL PUBLIC CLASS DEFINITION
+  * ============================= */
+
+  var Modal = function ( content, options ) {
+    this.settings = $.extend({}, $.fn.modal.defaults, options)
+    this.$element = $(content)
+      .delegate('.close', 'click.modal', $.proxy(this.hide, this))
+
+    if ( this.settings.show ) {
+      this.show()
+    }
+
+    return this
+  }
+
+  Modal.prototype = {
+
+      toggle: function () {
+        return this[!this.isShown ? 'show' : 'hide']()
+      }
+
+    , show: function () {
+        var that = this
+        this.isShown = true
+        this.$element.trigger('show')
+
+        escape.call(this)
+        backdrop.call(this, function () {
+          var transition = $.support.transition && that.$element.hasClass('fade')
+
+          that.$element
+            .appendTo(document.body)
+            .show()
+
+          if (transition) {
+            that.$element[0].offsetWidth // force reflow
+          }
+
+          that.$element.addClass('in')
+
+          transition ?
+            that.$element.one(transitionEnd, function () { that.$element.trigger('shown') }) :
+            that.$element.trigger('shown')
+
+        })
+
+        return this
+      }
+
+    , hide: function (e) {
+        e && e.preventDefault()
+
+        if ( !this.isShown ) {
+          return this
+        }
+
+        var that = this
+        this.isShown = false
+
+        escape.call(this)
+
+        this.$element
+          .trigger('hide')
+          .removeClass('in')
+
+        $.support.transition && this.$element.hasClass('fade') ?
+          hideWithTransition.call(this) :
+          hideModal.call(this)
+
+        return this
+      }
+
+  }
+
+
+ /* MODAL PRIVATE METHODS
+  * ===================== */
+
+  function hideWithTransition() {
+    // firefox drops transitionEnd events :{o
+    var that = this
+      , timeout = setTimeout(function () {
+          that.$element.unbind(transitionEnd)
+          hideModal.call(that)
+        }, 500)
+
+    this.$element.one(transitionEnd, function () {
+      clearTimeout(timeout)
+      hideModal.call(that)
+    })
+  }
+
+  function hideModal (that) {
+    this.$element
+      .hide()
+      .trigger('hidden')
+
+    backdrop.call(this)
+  }
+
+  function backdrop ( callback ) {
+    var that = this
+      , animate = this.$element.hasClass('fade') ? 'fade' : ''
+    if ( this.isShown && this.settings.backdrop ) {
+      var doAnimate = $.support.transition && animate
+
+      this.$backdrop = $('<div class="modal-backdrop ' + animate + '" />')
+        .appendTo(document.body)
+
+      if ( this.settings.backdrop != 'static' ) {
+        this.$backdrop.click($.proxy(this.hide, this))
+      }
+
+      if ( doAnimate ) {
+        this.$backdrop[0].offsetWidth // force reflow
+      }
+
+      this.$backdrop.addClass('in')
+
+      doAnimate ?
+        this.$backdrop.one(transitionEnd, callback) :
+        callback()
+
+    } else if ( !this.isShown && this.$backdrop ) {
+      this.$backdrop.removeClass('in')
+
+      $.support.transition && this.$element.hasClass('fade')?
+        this.$backdrop.one(transitionEnd, $.proxy(removeBackdrop, this)) :
+        removeBackdrop.call(this)
+
+    } else if ( callback ) {
+       callback()
+    }
+  }
+
+  function removeBackdrop() {
+    this.$backdrop.remove()
+    this.$backdrop = null
+  }
+
+  function escape() {
+    var that = this
+    if ( this.isShown && this.settings.keyboard ) {
+      $(document).bind('keyup.modal', function ( e ) {
+        if ( e.which == 27 ) {
+          that.hide()
+        }
+      })
+    } else if ( !this.isShown ) {
+      $(document).unbind('keyup.modal')
+    }
+  }
+
+
+ /* MODAL PLUGIN DEFINITION
+  * ======================= */
+
+  $.fn.modal = function ( options ) {
+    var modal = this.data('modal')
+
+    if (!modal) {
+
+      if (typeof options == 'string') {
+        options = {
+          show: /show|toggle/.test(options)
+        }
+      }
+
+      return this.each(function () {
+        $(this).data('modal', new Modal(this, options))
+      })
+    }
+
+    if ( options === true ) {
+      return modal
+    }
+
+    if ( typeof options == 'string' ) {
+      modal[options]()
+    } else if ( modal ) {
+      modal.toggle()
+    }
+
+    return this
+  }
+
+  $.fn.modal.Modal = Modal
+
+  $.fn.modal.defaults = {
+    backdrop: false
+  , keyboard: false
+  , show: false
+  }
+
+
+ /* MODAL DATA- IMPLEMENTATION
+  * ========================== */
+
+  $(document).ready(function () {
+    $('body').delegate('[data-controls-modal]', 'click', function (e) {
+      e.preventDefault()
+      var $this = $(this).data('show', true)
+      $('#' + $this.attr('data-controls-modal')).modal( $this.data() )
+    })
+  })
+
+}( window.jQuery || window.ender );

Propchange: archiva/site/src/site/resources/js/bootstrap-modal.1.4.0.js
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: archiva/site/src/site/resources/js/bootstrap-modal.1.4.0.js
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Modified: archiva/site/src/site/resources/js/index.js
URL: http://svn.apache.org/viewvc/archiva/site/src/site/resources/js/index.js?rev=1294292&r1=1294291&r2=1294292&view=diff
==============================================================================
--- archiva/site/src/site/resources/js/index.js (original)
+++ archiva/site/src/site/resources/js/index.js Mon Feb 27 19:28:38 2012
@@ -1,10 +1,13 @@
 $(document).ready(function(){
- $('#dialog').jqm();
- $('#dialog').jqmAddTrigger($('span.expand:eq(0)').find('a'));
- $('#dialog').jqmAddClose($('#dialog').find('span'));
- $('#dialogPreview').jqm();
- $('#dialogPreview').jqmAddTrigger($('span.expand:eq(1)').find('a'));
- $('#dialogPreview').jqmAddClose($('#dialogPreview').find('span'));
+
+ $("#openDialogRelease" ).on("click",function(){
+   $('#dialogRelease').modal('show');
+ })
+
+  $("#openDialogPreview" ).on("click",function(){
+    $('#dialogPreview').modal('show');
+  })
+
  $("a#single_image").fancybox({
    'transitionIn'	:	'elastic',
    'transitionOut'	:	'elastic',

Modified: archiva/site/src/site/xdoc/index.xml.vm
URL: http://svn.apache.org/viewvc/archiva/site/src/site/xdoc/index.xml.vm?rev=1294292&r1=1294291&r2=1294292&view=diff
==============================================================================
--- archiva/site/src/site/xdoc/index.xml.vm (original)
+++ archiva/site/src/site/xdoc/index.xml.vm Mon Feb 27 19:28:38 2012
@@ -24,14 +24,15 @@
     <author email="brett@apache.org">Brett Porter</author>
   </properties>
   <body>
-    <link rel="stylesheet" href="css/jqModal.css" type="text/css" media="screen" />
     <script src="js/jquery-1.7.1.min.js" type="text/javascript"></script>
-    <script src="js/jqModal.js" type="text/javascript"></script>
+
     <script type="text/javascript" src="js/index.js"></script>
     <script src="js/jquery.fancybox.pack-2.0.4.js" type="text/javascript"></script>
     <script src="js/jquery.easing-1.3.pack.js" type="text/javascript"></script>
     <script src="js/jquery.mousewheel-3.0.6.pack.js" type="text/javascript"></script>
     <link rel="stylesheet" href="css/jquery.fancybox-2.0.4.css" type="text/css" media="screen" />
+    <script src="js/bootstrap-modal.1.4.0.js" type="text/javascript"></script>
+    <script src="js/bootstrap-dropdown.1.4.0.js"type="text/javascript"></script>
 
     <style type="text/css">
       div.section {
@@ -157,13 +158,14 @@
           <p>
             <span class="expand">
               <img src="images/collapsed.gif" width="7" height="7" alt="" />
-              <strong>Latest stable release</strong>: <a href="#">Archiva ${archivaReleaseVersion}</a> - ${archivaReleaseDate}
+
+              <strong>Latest stable release</strong>: <a href="#" id="openDialogRelease">Archiva ${archivaReleaseVersion}</a> - ${archivaReleaseDate}
             </span>
             <br/>
 #if ($archivaPreviewVersion)
             <span class="expand">
               <img src="images/collapsed.gif" width="7" height="7" alt="" />
-              <strong>Latest preview release</strong>: <a href="#">Archiva ${archivaPreviewVersion}</a> - ${archivaPreviewDate}
+              <strong>Latest preview release</strong>: <a href="#" id="openDialogPreview">Archiva ${archivaPreviewVersion}</a> - ${archivaPreviewDate}
             </span>
             <br/>
 #end
@@ -174,66 +176,76 @@
           </p>
         </div>
       </div>
-      <div id="dialog" class="jqmWindow">
-        <span class="jqmClose">[x]</span>
-        <h1>Archiva ${archivaReleaseVersion}</h1>
+      <div id="dialogRelease" class="modal hide fade">
+        <div class="modal-header">
+          <a class="close" href="#">[&#215;]</a>
+            <h1>Archiva ${archivaReleaseVersion}</h1>
+        </div>
+        <div class="modal-body">
         <p>
           This is the recommended latest release of Archiva.
         </p>
-        <div class="linkBox">
-          <table>
-            <tr>
-              <th> </th>
-              <th>Mirrors</th>
-              <th>Checksum</th>
-              <th>Signature</th>
-            </tr>
-            <tr>
-              <td>Archiva ${archivaReleaseVersion} Standalone</td>
-              <td><a href="http://www.apache.org/dyn/closer.cgi/archiva/binaries/apache-archiva-${archivaReleaseVersion}-bin.zip">zip</a></td>
-              <td><a href="http://www.apache.org/dist/archiva/binaries/apache-archiva-${archivaReleaseVersion}-bin.zip.md5">md5</a></td>
-              <td><a href="http://www.apache.org/dist/archiva/binaries/apache-archiva-${archivaReleaseVersion}-bin.zip.asc">asc</a></td>
-            </tr>
-            <tr>
-              <td>Archiva ${archivaReleaseVersion} WAR</td>
-              <td><a href="http://www.apache.org/dyn/closer.cgi/archiva/binaries/apache-archiva-${archivaReleaseVersion}.war">war</a></td>
-              <td><a href="http://www.apache.org/dist/archiva/binaries/apache-archiva-${archivaReleaseVersion}.war.md5">md5</a></td>
-              <td><a href="http://www.apache.org/dist/archiva/binaries/apache-archiva-${archivaReleaseVersion}.war.asc">asc</a></td>
-            </tr>
-          </table> 
+          <div class="linkBox">
+            <table>
+              <tr>
+                <th> </th>
+                <th>Mirrors</th>
+                <th>Checksum</th>
+                <th>Signature</th>
+              </tr>
+              <tr>
+                <td>Archiva ${archivaReleaseVersion} Standalone</td>
+                <td><a href="http://www.apache.org/dyn/closer.cgi/archiva/binaries/apache-archiva-${archivaReleaseVersion}-bin.zip">zip</a></td>
+                <td><a href="http://www.apache.org/dist/archiva/binaries/apache-archiva-${archivaReleaseVersion}-bin.zip.md5">md5</a></td>
+                <td><a href="http://www.apache.org/dist/archiva/binaries/apache-archiva-${archivaReleaseVersion}-bin.zip.asc">asc</a></td>
+              </tr>
+              <tr>
+                <td>Archiva ${archivaReleaseVersion} WAR</td>
+                <td><a href="http://www.apache.org/dyn/closer.cgi/archiva/binaries/apache-archiva-${archivaReleaseVersion}.war">war</a></td>
+                <td><a href="http://www.apache.org/dist/archiva/binaries/apache-archiva-${archivaReleaseVersion}.war.md5">md5</a></td>
+                <td><a href="http://www.apache.org/dist/archiva/binaries/apache-archiva-${archivaReleaseVersion}.war.asc">asc</a></td>
+              </tr>
+            </table>
+          </div>
+        </div>
+        <div class="modal-footer">
+          <p><a href="docs/${archivaReleaseVersion}/release-notes.html">Release Notes</a> | <a href="download.html">More downloads</a></p>
         </div>
-        <p><a href="docs/${archivaReleaseVersion}/release-notes.html">Release Notes</a> | <a href="download.html">More downloads</a></p>
       </div>
 #if ($archivaPreviewVersion)
-      <div id="dialogPreview" class="jqmWindow">
-        <span class="jqmClose">[x]</span>
-        <h1>Archiva ${archivaPreviewVersion}</h1>
-        <p>
-          This is a preview of the next release of Archiva.
-        </p>
-        <div class="linkBox">
-          <table>
-            <tr>
-              <th> </th>
-              <th>Mirrors</th>
-              <th>Checksum</th>
-              <th>Signature</th>
-            </tr>
-            <tr>
-              <td>Archiva ${archivaPreviewVersion} Standalone</td>
-              <td><a href="http://www.apache.org/dyn/closer.cgi/archiva/binaries/apache-archiva-${archivaPreviewVersion}-bin.zip">zip</a></td>
-              <td><a href="http://www.apache.org/dist/archiva/binaries/apache-archiva-${archivaPreviewVersion}-bin.zip.md5">md5</a></td>
-              <td><a href="http://www.apache.org/dist/archiva/binaries/apache-archiva-${archivaPreviewVersion}-bin.zip.asc">asc</a></td>
-            </tr>
-            <tr>
-              <td>Archiva ${archivaPreviewVersion} WAR</td>
-              <td><a href="http://www.apache.org/dyn/closer.cgi/archiva/binaries/apache-archiva-${archivaPreviewVersion}.war">war</a></td>
-              <td><a href="http://www.apache.org/dist/archiva/binaries/apache-archiva-${archivaPreviewVersion}.war.md5">md5</a></td>
-              <td><a href="http://www.apache.org/dist/archiva/binaries/apache-archiva-${archivaPreviewVersion}.war.asc">asc</a></td>
-            </tr>
-          </table> 
+      <div id="dialogPreview" class="modal hide fade">
+        <div class="modal-header">
+          <a class="close" href="#">[&#215;]</a>
+          <h1>Archiva ${archivaPreviewVersion}</h1>
+        </div>
+        <div class="modal-body">
+          <p>This is a preview of the next release of Archiva.</p>
+          <div class="linkBox">
+            <table>
+              <tr>
+                <th> </th>
+                <th>Mirrors</th>
+                <th>Checksum</th>
+                <th>Signature</th>
+              </tr>
+              <tr>
+                <td>Archiva ${archivaPreviewVersion} Standalone</td>
+                <td><a href="http://www.apache.org/dyn/closer.cgi/archiva/binaries/apache-archiva-${archivaPreviewVersion}-bin.zip">zip</a></td>
+                <td><a href="http://www.apache.org/dist/archiva/binaries/apache-archiva-${archivaPreviewVersion}-bin.zip.md5">md5</a></td>
+                <td><a href="http://www.apache.org/dist/archiva/binaries/apache-archiva-${archivaPreviewVersion}-bin.zip.asc">asc</a></td>
+              </tr>
+              <tr>
+                <td>Archiva ${archivaPreviewVersion} WAR</td>
+                <td><a href="http://www.apache.org/dyn/closer.cgi/archiva/binaries/apache-archiva-${archivaPreviewVersion}.war">war</a></td>
+                <td><a href="http://www.apache.org/dist/archiva/binaries/apache-archiva-${archivaPreviewVersion}.war.md5">md5</a></td>
+                <td><a href="http://www.apache.org/dist/archiva/binaries/apache-archiva-${archivaPreviewVersion}.war.asc">asc</a></td>
+              </tr>
+            </table>
+          </div>
+        </div>
+        <div class="modal-footer">
+          <p><a href="docs/${archivaPreviewVersion}/release-notes.html">Release Notes</a> | <a href="download.html">More downloads</a></p>
         </div>
-        <p><a href="docs/${archivaPreviewVersion}/release-notes.html">Release Notes</a> | <a href="download.html">More downloads</a></p>
       </div>
 #end
       <div class="mainBox">