mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-10-29 10:20:08 +00:00
some cleanup...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
69e684eb7d
commit
7c623d7c76
@ -1,64 +0,0 @@
|
||||
/**********************************************************************
|
||||
*
|
||||
*
|
||||
*
|
||||
**********************************************************************/
|
||||
|
||||
define(function(require){ var module = {}
|
||||
|
||||
//var DEBUG = DEBUG != null ? DEBUG : true
|
||||
|
||||
var toggler = require('lib/toggler')
|
||||
|
||||
|
||||
/*********************************************************************/
|
||||
|
||||
module.launchFullScreen = function(elem) {
|
||||
if(elem.requestFullscreen) {
|
||||
elem.requestFullscreen();
|
||||
} else if(elem.mozRequestFullScreen) {
|
||||
elem.mozRequestFullScreen();
|
||||
} else if(elem.webkitRequestFullscreen) {
|
||||
elem.webkitRequestFullscreen();
|
||||
} else if(elem.msRequestFullscreen) {
|
||||
elem.msRequestFullscreen();
|
||||
}
|
||||
}
|
||||
|
||||
module.exitFullscreen = function() {
|
||||
if(document.exitFullscreen) {
|
||||
document.exitFullscreen();
|
||||
} else if(document.mozCancelFullScreen) {
|
||||
document.mozCancelFullScreen();
|
||||
} else if(document.webkitExitFullscreen) {
|
||||
document.webkitExitFullscreen();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
window.toggleFullscreenMode =
|
||||
module.toggleFullscreenMode = toggler.CSSClassToggler(
|
||||
document.body,
|
||||
'.full-screen-mode',
|
||||
function(action){
|
||||
if(action == 'on'){
|
||||
module.launchFullScreen(document.documentElement)
|
||||
} else {
|
||||
module.exitFullscreen()
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
|
||||
window.setWindowTitle =
|
||||
module.setWindowTitle = function(text){
|
||||
var title = text +' - '+ CONFIG.app_name
|
||||
$('.title-bar .title').text(title)
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**********************************************************************
|
||||
* vim:set ts=4 sw=4 : */
|
||||
return module })
|
||||
@ -374,10 +374,12 @@ module.ViewerActions = actions.Actions({
|
||||
function(){ return this.ribbons.viewer },
|
||||
function(){ return this.config['ribbon-themes'] },
|
||||
function(state){ this.config['ribbon-theme'] = state }) ],
|
||||
|
||||
/*
|
||||
setEmptyMsg: ['- Interface/Set message to be displayed when nothing is loaded.',
|
||||
function(msg, help){ this.ribbons
|
||||
&& this.ribbons.length > 0
|
||||
&& this.ribbons.setEmptyMsg(msg, help) }],
|
||||
*/
|
||||
|
||||
|
||||
// align modes...
|
||||
|
||||
@ -2374,11 +2374,6 @@ var RibbonsPrototype = {
|
||||
|
||||
|
||||
setEmptyMsg: function(msg, help){
|
||||
this.viewer
|
||||
.attr({
|
||||
'empty-msg': msg || '',
|
||||
'empty-help': help || '',
|
||||
})
|
||||
this.getRibbonSet()
|
||||
.attr({
|
||||
'empty-msg': msg || '',
|
||||
|
||||
@ -3,27 +3,23 @@
|
||||
*
|
||||
*
|
||||
**********************************************************************/
|
||||
|
||||
window.nodejs = (typeof(process) === 'object' && process.features.uv)
|
||||
? {
|
||||
require: window.require,
|
||||
}
|
||||
: null
|
||||
|
||||
// Pre-setup...
|
||||
|
||||
// Add node_modules path outside of the packed nwjs code...
|
||||
//
|
||||
// This keeps the large node module set outside the zip thus speeding
|
||||
// up the loading process significantly...
|
||||
if(window.process || global.process && process.__nwjs){
|
||||
if((typeof(process) != 'undefined' ? process : {}).__nwjs){
|
||||
var path = require('path')
|
||||
require('app-module-path')
|
||||
.addPath(path.dirname(process.execPath) + '/node_modules/')
|
||||
}
|
||||
|
||||
|
||||
// XXX for some reason requirejs does not fall back to node's require...
|
||||
if(nodejs){
|
||||
// Setup requirejs if we are in node/nw...
|
||||
//
|
||||
// NOTE: no need to do this in browser...
|
||||
if(typeof(process) != 'undefined'){
|
||||
var requirejs = require('requirejs')
|
||||
|
||||
requirejs.config({
|
||||
@ -37,26 +33,14 @@ if(nodejs){
|
||||
|
||||
|
||||
|
||||
/*********************************************************************/
|
||||
|
||||
define(function(require){ var module = {}
|
||||
|
||||
//var DEBUG = DEBUG != null ? DEBUG : true
|
||||
|
||||
var keyboard = require('lib/keyboard')
|
||||
var doc = keyboard.doc
|
||||
|
||||
// compatibility...
|
||||
var browser = require('browser')
|
||||
var nw = require('nw')
|
||||
|
||||
// XXX load only the actualy used here modules...
|
||||
var actions = require('lib/actions')
|
||||
var data = require('data')
|
||||
var ribbons = require('ribbons')
|
||||
|
||||
var viewer = require('viewer')
|
||||
|
||||
//var promise = require('promise')
|
||||
|
||||
|
||||
|
||||
/*********************************************************************/
|
||||
@ -104,7 +88,6 @@ $(function(){
|
||||
// setup the viewer...
|
||||
a
|
||||
.load({ viewer: $('.viewer') })
|
||||
.setEmptyMsg('Loading...')
|
||||
.start()
|
||||
|
||||
|
||||
@ -118,13 +101,6 @@ $(function(){
|
||||
// do not do for actual data...
|
||||
//.syncTags()
|
||||
}
|
||||
|
||||
|
||||
// XXX calling a.clear() does not display this...
|
||||
a.setEmptyMsg(
|
||||
'Nothing loaded...',
|
||||
'Press \'O\' to load, \'F1\' for help or \'?\' for keyboard mappings.')
|
||||
|
||||
})
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user