Skip to content

Commit

Permalink
Corrige 'Unexpected token'
Browse files Browse the repository at this point in the history
Passa a pegar o location.url sem o '?authenticator=' para evitar o erro

    Unexpected token <
  • Loading branch information
idgserpro committed Apr 7, 2016
1 parent 0709177 commit f09236c
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ Alterações
buildout.cfg e as versões mais novas no momento desse release de
brasil.gov.tiles contém upgrades.

- Corrige erro "Unexpected token <" quando se utiliza collective.cover com
suporte a proteção CSRF.
[idgserpro]

- Corrige ícones dos tiles presentes em overrides já que nas versões de
collective.cover >= 1.0a13 a estrutura dos recursos estáticos foi alterada.
(closes `#140`).
Expand Down
2 changes: 1 addition & 1 deletion src/brasil/gov/tiles/static/tiles.js
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ $(function() {

$.extend(self, {
init: function(){
Galleria.loadTheme(window.location.href.trim('/') + '/++resource++brasil.gov.tiles/galleria.classic.min.js');
Galleria.loadTheme(window.location.protocol + '//' + window.location.host + location.pathname + '/++resource++brasil.gov.tiles/galleria.classic.min.js');

Galleria.configure({
_toggleInfo: false, // Set this to false if you want the caption to show always
Expand Down
7 changes: 6 additions & 1 deletion src/brasil/gov/tiles/tests/test_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,15 @@ def setUp(self):
UpgradeTestCaseBase.setUp(self, u'3000', u'4000')
self.profile_id = u'brasil.gov.tiles:default'

def test_upgrade_to_10_registrations(self):
# XXX: Como herdo de Upgrade9to10TestCase mas possuo dois upgradeSteps
# esse método dá erro, mas não preciso dele.
pass

def test_upgrade_to_4000_registrations(self):
version = self.setup.getLastVersionForProfile(self.profile_id)[0]
self.assertTrue(int(version) >= int(self.to_version))
self.assertEqual(self._how_many_upgrades_to_do(), 1)
self.assertEqual(self._how_many_upgrades_to_do(), 2)

def test_new_uuids_structure(self):
title = u'Atualiza estrutura no banco do tipo Destaque'
Expand Down
11 changes: 11 additions & 0 deletions src/brasil/gov/tiles/upgrades/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,12 @@
# -*- coding: utf-8 -*-
from brasil.gov.tiles.config import PROJECTNAME
from plone import api

import logging

logger = logging.getLogger(PROJECTNAME)


def cook_javascript_resources(context):
api.portal.get_tool('portal_javascripts').cookResources()
logger.info('Javascript resources were cooked')
6 changes: 6 additions & 0 deletions src/brasil/gov/tiles/upgrades/v4000/configure.zcml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@
handler=".handler.fix_persistentmap_to_dict_destaque"
/>

<gs:upgradeStep
title="Recarrega tiles.js"
description="Com alteração no js preciso recarregar os js"
handler="..cook_javascript_resources"
/>

</gs:upgradeSteps>

</configure>

0 comments on commit f09236c

Please sign in to comment.