Skip to content
This repository has been archived by the owner on Jan 12, 2022. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge branch 'master' of github.com:mozilla/FlightDeck
  • Loading branch information
zalun committed Feb 23, 2012
2 parents 0b98912 + fe55d4d commit a11109f
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 32 deletions.
35 changes: 16 additions & 19 deletions apps/base/views.py
Expand Up @@ -37,12 +37,9 @@ def app_manifest(request):
'url': 'https://builder.addons.mozilla.org/',
},
'installs_allowed_from': [
'https://apps-preview-dev.allizom.org',
'https://apps-preview.allizom.org',
'https://apps-preview.mozilla.org',
'https://addons-dev.allizom.org',
'https://addons.allizom.org',
'https://addons.mozilla.org',
'https://marketplace-dev.allizom.org',
'https://marketplace.allizom.org',
'https://marketplace.mozilla.org',
],
'default_locale': 'en',
}
Expand All @@ -56,7 +53,7 @@ def graphite(request, site):
# have to hack together our own. This is temporary until we can replace it
# with jinja code.

v = {}
v = {}
v['ns'] = {"trunk": "builder.preview",
"stage": "builder.next",
"prod": "builder"}[site] # Validated by url regex
Expand Down Expand Up @@ -87,11 +84,11 @@ def admin(request):
if action == 'setup_mapping':
msg = 'setup_mapping triggered'
log.info(log_msg % (msg, request.user, request.user.pk))
threading.Thread(target=setup_mapping).start()
threading.Thread(target=setup_mapping).start()
elif action == 'index_all':
msg = 'index_all triggered'
log.info(log_msg % (msg , request.user, request.user.pk))
threading.Thread(target=index_all).start()
threading.Thread(target=index_all).start()
elif action == 'update_package_activity':
msg = 'update_package_activity triggered'
log.info(log_msg % (msg , request.user, request.user.pk))
Expand Down Expand Up @@ -205,25 +202,25 @@ def monitor(request):
return HttpResponse(template.render(context), status=status)


def get_package(request):
package = get_object_or_404(Package, id_number=request.GET['package_id'])
def get_package(request):
package = get_object_or_404(Package, id_number=request.GET['package_id'])
return render_to_response('admin/_package_result.html', {
'package': package
}, context_instance=RequestContext(request))

@user_passes_test(lambda u: u.is_superuser)
def update_package(request):
package = get_object_or_404(Package, pk=request.POST['package_id'])
if 'featured' in request.POST:
package = get_object_or_404(Package, pk=request.POST['package_id'])
if 'featured' in request.POST:
package.featured = request.POST.get('featured') == 'true'
if 'example' in request.POST:

if 'example' in request.POST:
package.example = request.POST.get('example') == 'true'
package.save()

package.save()
return HttpResponse({'status':'ok'}, content_type='text/javascript')


def homepage(r):
# one more for the main one
pkgs_limit = settings.HOMEPAGE_PACKAGES_NUMBER
Expand Down
10 changes: 7 additions & 3 deletions media/jetpack/js/ide/controllers/PackageController.js
Expand Up @@ -294,18 +294,22 @@ module.exports = new Class({

instantiate_modules: function() {
// iterate by modules and instantiate Module
var mainLoaded;
var mainLoaded = false,
firstModule;
this.options.modules.forEach(function(module) {
module.readonly = this.options.readonly;
var mod = this.newModule(module);
if (module.main) {
mainLoaded = true;
this.editFile(mod);
}
if (!firstModule) {
firstModule = mod;
}
}, this);

if (!mainLoaded && this.options.modules[0]) {
this.editFile(this.options.modules[0]);
if (!mainLoaded && firstModule) {
this.editFile(firstModule);
}
},

Expand Down
16 changes: 9 additions & 7 deletions media/jetpack/js/ide/controllers/TabsController.js
Expand Up @@ -8,10 +8,12 @@ var Class = require('shipyard/class/Class'),
log = require('shipyard/utils/log'),
dom = require('shipyard/dom'),

tabs = require('../views/Tabs'),
tabs = require('../views/Tabs');

//TODO: this is terrible practice
fd = dom.window.get('fd');
//TODO: this is terrible practice
function fd() {
return dom.window.get('fd');
}

module.exports = new Class({

Expand Down Expand Up @@ -42,7 +44,7 @@ module.exports = new Class({


if (file.changed) {
fd.showQuestion({
fd().showQuestion({
title: 'Lose unsaved changes?',
message: 'The tab "'+file.get('shortName')+'" that you are trying to close has unsaved changes.',
buttons: [
Expand All @@ -64,9 +66,9 @@ module.exports = new Class({
setTimeout(function() {
file.set('content', file.original_content);
file.setChanged(false);
fd.item.edited--;
if(!fd.item.edited) {
fd.item.emit('reset');
fd().item.edited--;
if(!fd().item.edited) {
fd().item.emit('reset');
}
}, 1);
}
Expand Down
4 changes: 2 additions & 2 deletions media/jetpack/js/ide/models/Attachment.js
Expand Up @@ -24,10 +24,10 @@ module.exports = new Class({
uid: property(function uid(pk) {
if (arguments.length === 0) {
// getter
return this.get('pk');
return this.get('id');
} else {
// setter
return this.set('pk', pk);
return this.set('id', pk);
}
}, 'id')

Expand Down
2 changes: 1 addition & 1 deletion media/lib/shipyard
Submodule shipyard updated from dc4046 to aeeea4

0 comments on commit a11109f

Please sign in to comment.