Skip to content

Commit

Permalink
Merge commit 'origin/master' into WINKSTART-543
Browse files Browse the repository at this point in the history
  • Loading branch information
JRMaitre committed Jan 5, 2012
2 parents eba6b82 + 01546af commit ac09ec7
Show file tree
Hide file tree
Showing 9 changed files with 112 additions and 88 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,6 @@
[submodule "whapps/indesign"]
path = whapps/indesign
url = [email protected]:2600hz/indesign.git
[submodule "whapps/voip/phone"]
path = whapps/voip/phone
url = [email protected]:2600hz/phone.git
1 change: 1 addition & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
<script type="text/javascript" src="js/external/lab.js"></script>
<script type="text/javascript" src="js/external/jquery.tooltip.js"></script>
<script type="text/javascript" src="js/external/jquery.cookie.js"></script>
<script type="text/javascript" src="js/external/jquery.masonry.min.js"></script>

<script type="text/javascript" src="js/amplify/_amplify.js"></script>
<script>var _amplify = amplify;</script>
Expand Down
Empty file modified js/external/form2object.js
100755 → 100644
Empty file.
Empty file modified js/external/jquery-ui-1.8.7.custom.min.js
100755 → 100644
Empty file.
1 change: 1 addition & 0 deletions js/external/jquery.masonry.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

170 changes: 87 additions & 83 deletions js/winkstart.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
(function(winkstart, amplify, undefined) {
var modules = {},
var modules = {},
loading = {},
locked_topics = {},
slice = [].slice;
winkstart.publish = function(locking) {

winkstart.publish = function(locking) {
var args = arguments,
ret;

Expand Down Expand Up @@ -34,88 +34,92 @@
return ret;
}

winkstart.subscribe = amplify.subscribe;
winkstart.unsubscribe = amplify.unsubscribe;
winkstart.module = amplify.module;
amplify.module.constructor = function(args, callback) {
var completed = 0, THIS = this;
if ( this.config.templates ) {
this.templates = {};
$.each(this.config.templates, function(name, url) {
completed++;
winkstart.subscribe = amplify.subscribe;
winkstart.unsubscribe = amplify.unsubscribe;

winkstart.module = amplify.module;
amplify.module.constructor = function(args, callback) {
var completed = 0, THIS = this;
if ( this.config.templates ) {
this.templates = {};
$.each(this.config.templates, function(name, url) {
completed++;
// Make sure you set cache = false, or things really suck
$.ajax({
$.ajax({
url: 'whapps/' + THIS.__whapp + '/' + THIS.__module + '/' + url,
cache: false,
success: function(template) {
completed--;
THIS.templates[name] = $(template);
}});
});
}
if ( this.config.requires ) {
$.each(this.config.requires, function(k, module) {
completed--;
THIS.templates[name] = $(template);
}});
});
}
if ( this.config.requires ) {
$.each(this.config.requires, function(k, module) {
winkstart.log('Loading dependency ' + k + ' ' + module);
completed++;
amplify.module.loadModule(k, module, function() {
completed--;
});
});
}
if ( this.config.css ) {
$.each(this.config.css, function(k, css) {
if ( css === true ) {
THIS.__module + '.css';
}
css = 'whapps/' + THIS.__whapp + '/' + THIS.__module + '/' + css;
//completed++;
$('<link href="' + css + '" rel="stylesheet" type="text/css">').bind('load', function() {
//completed--;
}).appendTo('head');
});
}
if ( this.config.subscribe ) {
$.each(this.config.subscribe, function(k, v) {
winkstart.subscribe(k, function() {
if ( THIS[v] ) {
THIS[v].apply(THIS, arguments);
}
});
});
}

setTimeout(function() {
completed = 0;
}, 3000);

(function() {
if ( completed == 0 ) {
if ( $.isFunction(callback) ) {
callback();
}
return;
}
var _c = arguments.callee;
setTimeout(function() { _c(); }, 10);
})();
};

// Bootstrap the app: Start by loading the core module
winkstart.module.loadApp('core', function() {
// Create an instance of the core module, which loads layouts and all whApps
this.init();

/* winkstart.module.loadModule('core', 'layout', function() {
this.init({ parent: $('body') }, function() {
//Bootstrap some form data
$.getJSON('endpoint/form/data.json', function(data){
amplify.store('form_data', data);
});
});
});
});*/
});

})( window.winkstart = window.winkstart || {}, window.amplify = window.amplify || {});
completed++;
amplify.module.loadModule(k, module, function() {
completed--;
});
});
}
if ( this.config.css ) {
$.each(this.config.css, function(k, css) {
if ( css === true ) {
THIS.__module + '.css';
}
css = 'whapps/' + THIS.__whapp + '/' + THIS.__module + '/' + css;
//completed++;
$('<link href="' + css + '" rel="stylesheet" type="text/css">').bind('load', function() {
//completed--;
}).appendTo('head');
});
}
if ( this.config.subscribe ) {
$.each(this.config.subscribe, function(k, v) {
winkstart.subscribe(k, function() {
var ret = true;

if ( THIS[v] ) {
ret = THIS[v].apply(THIS, arguments);
}

return ret;
});
});
}

setTimeout(function() {
completed = 0;
}, 3000);

(function() {
if ( completed == 0 ) {
if ( $.isFunction(callback) ) {
callback();
}
return;
}
var _c = arguments.callee;
setTimeout(function() { _c(); }, 10);
})();
};

// Bootstrap the app: Start by loading the core module
winkstart.module.loadApp('core', function() {
// Create an instance of the core module, which loads layouts and all whApps
this.init();

/* winkstart.module.loadModule('core', 'layout', function() {
this.init({ parent: $('body') }, function() {
//Bootstrap some form data
$.getJSON('endpoint/form/data.json', function(data){
amplify.store('form_data', data);
});
});
});
});*/
});

})( window.winkstart = window.winkstart || {}, window.amplify = window.amplify || {});
23 changes: 18 additions & 5 deletions whapps/voip/device/device.js
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,8 @@ winkstart.module('voip', 'device', {

render_device: function(data, target, callbacks){
var THIS = this,
device_html;
device_html,
render;

if(typeof data.data == 'object' && data.data.device_type) {
device_html = THIS.templates[data.data.device_type].tmpl(data);
Expand Down Expand Up @@ -518,7 +519,7 @@ winkstart.module('voip', 'device', {
winkstart.publish('media.popup_edit', _data, function(_data) {
/* Create */
if(!_id) {
$('#music_on_hold_media_id', device_html).append('<option id="'+ _data.data.id +'" value="'+ _data.data.id +'">'+ _data.data.name +'</option>')
$('#music_on_hold_media_id', device_html).append('<option id="'+ _data.data.id +'" value="'+ _data.data.id +'">'+ _data.data.name +'</option>');
$('#music_on_hold_media_id', device_html).val(_data.data.id);

$('#edit_link_media', device_html).show();
Expand Down Expand Up @@ -555,9 +556,21 @@ winkstart.module('voip', 'device', {
});
}

(target)
.empty()
.append(device_html);
/* Awesome sauce for provisioning goodness */
render = function() {
(target)
.empty()
.append(device_html);
};

if(typeof data.data == 'object' && data.data.device_type == 'sip_device') {
if(winkstart.publish('phone.render_fields', $('.provisioner', device_html), data.data.provision || (data.data.provision = {}), render)) {
render();
}
}
else {
render();
}
},

migrate_data: function(data) {
Expand Down
1 change: 1 addition & 0 deletions whapps/voip/device/tmpl/edit.html
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ <h1>Edit SIP Device</h1>
<label for="mac_address">Device MAC Address:</label>
</span>
<input id="mac_address" placeholder="01:23:45:67:89:AB" name="mac_address" type="text" value="${data.mac_address}" />
<span class="provisioner"></span>
</li>
<li>
<span class="tooltip-wrapper" tooltip="Do you want this device enabled?">
Expand Down
1 change: 1 addition & 0 deletions whapps/voip/phone
Submodule phone added at 0c192a

0 comments on commit ac09ec7

Please sign in to comment.