[Git][noosfero/noosfero][master] 2 commits: Fix JS that was trying to return something null

Rodrigo Souto gitlab at gitlab.com
Tue Jun 16 11:19:50 BRT 2015


Rodrigo Souto pushed to branch master at Noosfero / noosfero


Commits:
21759b79 by Gabriela Navarro at 2015-06-15T20:49:15Z
Fix JS that was trying to return something null

Signed-off-by: Gabriela Navarro <navarro1703 at gmail.com>

- - - - -
1c721a96 by Rodrigo Souto at 2015-06-16T14:19:39Z
Merge branch 'selenium_fixies' into 'master'

Fix JS from fullscreen

This patch fixes the JS that was returning null on article view page and not making the "Zoom in" of image feature appear.

See merge request !602

- - - - -


2 changed files:

- + features/article_visualization.feature
- public/javascripts/application.js


Changes:

=====================================
features/article_visualization.feature
=====================================
--- /dev/null
+++ b/features/article_visualization.feature
@@ -0,0 +1,30 @@
+Feature: article visualization
+  As a user
+  I want to change view modes
+  In order to see articles in fullscreen or not in fullscreen
+
+  Background:
+    Given the following users
+      | login     | name       |
+      | joaosilva | Joao Silva |
+    And "joaosilva" has no articles
+    And the following articles
+      | owner     | name           | body               |
+      | joaosilva | Sample Article | This is an article |
+    And I am logged in as "joaosilva"
+
+  @selenium
+  Scenario: viewing the article in fullscreen by default
+    Given I go to /joaosilva/sample-article?fullscreen=1
+    Then I should see "Exit full screen"
+
+  @selenium
+  Scenario: viewing the article not in fullscreen by default
+    Given I go to /joaosilva/sample-article
+    Then I should see "Full screen"
+
+  @selenium
+  Scenario: changing the view mode from not in fullscreen to fullscreen
+    Given I go to /joaosilva/sample-article
+    And I follow "Full screen"
+    Then I should see "Exit full screen"


=====================================
public/javascripts/application.js
=====================================
--- a/public/javascripts/application.js
+++ b/public/javascripts/application.js
@@ -1178,7 +1178,10 @@ window.isHidden = function isHidden() { return (typeof(document.hidden) != 'unde
 
 function $_GET(id){
     var a = new RegExp(id+"=([^&#=]*)");
-    return decodeURIComponent(a.exec(window.location.search)[1]);
+    var result_of_search = a.exec(window.location.search)
+    if(result_of_search != null){
+      return decodeURIComponent(result_of_search[1]);
+    }
 }
 
 var fullwidth=false;
@@ -1206,4 +1209,3 @@ function fullscreenPageLoad(itemId){
     }
   });
 }
-



View it on GitLab: https://gitlab.com/noosfero/noosfero/compare/9a1c00d4886c88286d43c22d1655291d18a0abf0...1c721a96be2bf4f93ad0458dc219f63a9ffca722
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listas.softwarelivre.org/pipermail/noosfero-dev/attachments/20150616/ab170b56/attachment-0001.html>


More information about the Noosfero-dev mailing list