Comments (12)
That'd be interesting to have indeed. I'll have a look but I think django's media system does a bit of magic wrt media handling. You could try subclassing the Base* widgets and set their Media.js attributes but I'm not sure it'll completely override the original widget's media files.
That said, I don't think you can host the google maps API yourself. With OpenLayers it's not an issue but I can imagine it'd break the google maps terms of service or something.
I haven't tried django-compressor with that stuff, the idea of the CDN versions is that you have a better chance of getting the library from the browser cache. Less data transfer but one more connection to make, the best way to know would be to try and measure :)
from django-floppyforms.
There is an issue with using OpenLayer.js on remote hosting.
If you are using ssl (https) chrome will block javascript without https (so for example OpenLayer.js are blocked and OpenStreetMaps). I think we should embed OpenLayers into floppyforms. I will send pull request to resolve that issue.
Also for Google and OSM we should have ability to choose scripts with or without https.
from django-floppyforms.
@galuszkak Did you already do anything on the described efforts? After 10 months you propably lost interest or solved the problem differently, but maybe you can let us know how you did :)
Cheers!
from django-floppyforms.
@gregmuellegger I resolved this somehow, please give me 5-10 min I will find how I did it.
from django-floppyforms.
@gregmuellegger Ok I have it. I've created a widget with own Media. and embeded OpenLayers.js locally in static folder. If they can be added to floppyforms that still will be benefit for people using ssl because they won't be struggling with this bug :). If you have any more question please feel free to ask.
class PointWidget(floppyforms.gis.PointWidget, floppyforms.gis.BaseOsmWidget):
template_name = 'my_template/osm.html'
map_srid = 900913
def get_context_data(self):
ctx = super(PointWidget, self).get_context_data()
ctx.update({
'center_point_lat': str(self.center_point_lat).replace(',', '.'),
'center_point_long': str(self.center_point_long).replace(',', '.'),
'admin': self.admin,
})
return ctx
class Media:
extend = False
js = ('js/openlayers/OpenLayers.js',
'https://www.openstreetmap.org/openlayers/OpenStreetMap.js',
'floppyforms/js/MapWidget.js')
from django-floppyforms.
Thanks for taking the time to reply that quickly! I will try to incorporate that at some point into floppyforms.
from django-floppyforms.
Good Job @gregmuellegger 👍
from django-floppyforms.
Took a few years but finally it for good ;)
Am 17.02.2015 00:31 schrieb "Kamil Gałuszka" [email protected]:
Good Job @gregmuellegger https://github.com/gregmuellegger [image: 👍]
—
Reply to this email directly or view it on GitHub
#15 (comment)
.
from django-floppyforms.
django-floppyforms 1.4.0 is now available on PyPI which includes these changes. Thanks for the help!
https://pypi.python.org/pypi/django-floppyforms/
from django-floppyforms.
Hi! It looks like some of the OpenLayers static files didn't make it to PyPi. For example the theme/default/
directory is missing.
from django-floppyforms.
@mikeedwards Doh! You are absolutely right. I added them to the source distribution now and released 1.4.1 which includes these. Thanks for letting me know.
from django-floppyforms.
Awesome! Thank you for fixing that so quickly--totally made my morning!
from django-floppyforms.
Related Issues (20)
- How to use bootstrap style to `datalist`?!
- gis warning when I don't want to use gis HOT 5
- TypeError: get_context() got an unexpected keyword argument 'renderer' on Django 1.11.3 HOT 27
- VariableDoesNotExist: Failed lookup for key [help_text] in u'iban' HOT 1
- Custom radioselect required attrs Widget or rendered? HOT 1
- Endless Loop with django-debug-toolbar HOT 2
- the image_thumbnail.html example causes an error when image exist HOT 3
- Django 2.1 update causing for error, renderer() HOT 4
- Widgets not rendering extra attrs HOT 2
- Removed ORGException causes issues when using GeoDjango after 2.0 HOT 1
- Prepare 1.8.0 release
- Implement Jazzband guidelines for project django-floppyforms HOT 4
- [1.8.0 release blocker] Django templates breaking change? HOT 1
- GeoDjango widgets in admin site cannot be used as regular widgets with the Meta widgets attribute HOT 3
- Django 3 'six' incompatability HOT 2
- Is this project dead? HOT 7
- geodjango floppyform issue
- set extent of map using map_options HOT 3
- How to filter widget input datalist with user name
- Drop support for Python 3.6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from django-floppyforms.