소스 검색

Move website specific code out of main.js and into index.html. updates #229

Otherwise, we get errors "Cannot read property top of undefined".
JC Brand 10 년 전
부모
커밋
c71b03094d
8개의 변경된 파일23개의 추가작업 그리고 23개의 파일을 삭제
  1. 0 0
      builds/converse-no-locales-no-otr.min.js
  2. 0 0
      builds/converse-no-otr.min.js
  3. 0 0
      builds/converse.min.js
  4. 0 0
      builds/converse.website-no-otr.min.js
  5. 0 0
      builds/converse.website.min.js
  6. 1 0
      docs/CHANGES.rst
  7. 22 0
      index.html
  8. 0 23
      main.js

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 0 - 0
builds/converse-no-locales-no-otr.min.js


파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 0 - 0
builds/converse-no-otr.min.js


파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 0 - 0
builds/converse.min.js


파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 0 - 0
builds/converse.website-no-otr.min.js


파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 0 - 0
builds/converse.website.min.js


+ 1 - 0
docs/CHANGES.rst

@@ -5,6 +5,7 @@ Changelog
 ------------------
 
 * Bugfix. Error when trying to use prebind and keepalive together. [jcbrand]
+* Bugfix. Cannot read property "top" of undefined. [jcbrand]
 
 0.8.3 (2014-09-22)
 ------------------

+ 22 - 0
index.html

@@ -233,6 +233,28 @@
 <script>
     // Configuration loaded, so safe to make other require calls.
     require(['converse'], function (converse) {
+        (function () {
+            /* XXX: This function initializes jquery.easing for the https://conversejs.org
+            * website. This code is only useful in the context of the converse.js
+            * website and converse.js itself is NOT dependent on it.
+            */
+            $(window).scroll(function() {
+                if ($(".navbar").offset().top > 50) {
+                    $(".navbar-fixed-top").addClass("top-nav-collapse");
+                } else {
+                    $(".navbar-fixed-top").removeClass("top-nav-collapse");
+                }
+            });
+            //jQuery for page scrolling feature - requires jQuery Easing plugin
+            $('.page-scroll a').bind('click', function(event) {
+                var $anchor = $(this);
+                $('html, body').stop().animate({
+                    scrollTop: $($anchor.attr('href')).offset().top
+                }, 700, 'easeInOutExpo');
+                event.preventDefault();
+            });
+        })();
+
         converse.initialize({
             bosh_service_url: 'https://bind.conversejs.org', // Please use this connection manager only for testing purposes
             i18n: locales.en, // Refer to ./locale/locales.js to see which locales are supported

+ 0 - 23
main.js

@@ -151,32 +151,9 @@ config = {
     }
 };
 
-var initializeEasing = function () {
-    /* XXX: This function initializes jquery.easing for the https://conversejs.org
-     * website. This code is only useful in the context of the converse.js
-     * website and converse.js itself is not dependent on it.
-     */
-    $(window).scroll(function() {
-        if ($(".navbar").offset().top > 50) {
-            $(".navbar-fixed-top").addClass("top-nav-collapse");
-        } else {
-            $(".navbar-fixed-top").removeClass("top-nav-collapse");
-        }
-    });
-    //jQuery for page scrolling feature - requires jQuery Easing plugin
-    $('.page-scroll a').bind('click', function(event) {
-        var $anchor = $(this);
-        $('html, body').stop().animate({
-            scrollTop: $($anchor.attr('href')).offset().top
-        }, 700, 'easeInOutExpo');
-        event.preventDefault();
-    });
-};
-
 if (typeof(require) !== 'undefined') {
     require.config(config);
     require(["jquery", "converse"], function($, converse) {
         window.converse = converse;
-        initializeEasing(); // Only for https://conversejs.org website
     });
 }

이 변경점에서 너무 많은 파일들이 변경되어 몇몇 파일들은 표시되지 않았습니다.