forked from servee/servee
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c40067d
commit 66e5051
Showing
9 changed files
with
147 additions
and
175 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
VERSION = (0, 6, 0, "a", 1) # following PEP 386 | ||
DEV_N = "15" | ||
DEV_N = "18" | ||
|
||
|
||
# cribbed from pinax | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,25 @@ | ||
from django import template | ||
from django.contrib.admin.templatetags.admin_modify import submit_row | ||
|
||
register = template.Library() | ||
|
||
submit_row = register.inclusion_tag('servee/_submit_line.html', takes_context=True)(submit_row) | ||
def submit_row_frontendadmin(context): | ||
""" | ||
Displays the row of buttons for delete and save. | ||
""" | ||
opts = context['opts'] | ||
change = context['change'] | ||
is_popup = context['is_popup'] | ||
save_as = context['save_as'] | ||
return { | ||
'onclick_attrib': (opts.get_ordered_objects() and change | ||
and 'onclick="submitOrderForm();"' or ''), | ||
'show_delete_link': (not is_popup and context['has_delete_permission'] | ||
and (change or context['show_delete'])), | ||
'show_save_as_new': not is_popup and change and save_as, | ||
'show_save_and_add_another': context['has_add_permission'] and | ||
not is_popup and (not save_as or context['add']), | ||
'show_save_and_continue': not is_popup and context['has_change_permission'], | ||
'is_popup': is_popup, | ||
'show_save': True | ||
} | ||
register.inclusion_tag('servee/_submit_line.html', takes_context=True)(submit_row_frontendadmin) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 1 addition & 3 deletions
4
servee/wysiwyg/tinymce/static/tinymce/jscripts/tiny_mce/plugins/autoresize/editor_plugin.js
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
278 changes: 116 additions & 162 deletions
278
.../wysiwyg/tinymce/static/tinymce/jscripts/tiny_mce/plugins/autoresize/editor_plugin_src.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,165 +1,119 @@ | ||
/** | ||
* editor_plugin_src.js | ||
* | ||
* Copyright 2009, Moxiecode Systems AB | ||
* Released under LGPL License. | ||
* | ||
* License: http://tinymce.moxiecode.com/license | ||
* Contributing: http://tinymce.moxiecode.com/contributing | ||
*/ | ||
|
||
(function() { | ||
/** | ||
* Auto Resize | ||
* | ||
* This plugin automatically resizes the content area to fit its content height. | ||
* It will retain a minimum height, which is the height of the content area when | ||
* it's initialized. | ||
*/ | ||
tinymce.create('tinymce.plugins.AutoResizePlugin', { | ||
/** | ||
* Initializes the plugin, this will be executed after the plugin has been created. | ||
* This call is done before the editor instance has finished it's initialization so use the onInit event | ||
* of the editor instance to intercept that event. | ||
* | ||
* @param {tinymce.Editor} ed Editor instance that the plugin is initialized in. | ||
* @param {string} url Absolute URL to where the plugin is located. | ||
*/ | ||
init : function(ed, url) { | ||
var t = this; | ||
|
||
if (ed.getParam('fullscreen_is_enabled')) | ||
return; | ||
|
||
/** | ||
* This method gets executed each time the editor needs to resize. | ||
*/ | ||
function resize() { | ||
var d = ed.getDoc(), b = d.body, de = d.documentElement, DOM = tinymce.DOM, resizeHeight = t.autoresize_min_height, myHeight; | ||
|
||
// Get height differently depending on the browser used | ||
myHeight = (tinymce.isIE || tinymce.isWebKit || tinymce.isGecko) ? b.scrollHeight : de.offsetHeight; | ||
|
||
// Don't make it smaller than the minimum height | ||
if (myHeight > t.autoresize_min_height) | ||
resizeHeight = myHeight; | ||
|
||
// Resize content element, set scroll | ||
DOM.setStyle(DOM.get(ed.id + '_ifr'), 'height', resizeHeight + 'px'); | ||
|
||
// if we're throbbing, we'll re-throb to match the new size | ||
if (t.throbbing) { | ||
ed.setProgressState(false); | ||
ed.setProgressState(true); | ||
} | ||
}; | ||
|
||
t.editor = ed; | ||
|
||
// Define minimum height | ||
t.autoresize_min_height = ed.getElement().offsetHeight; | ||
|
||
// Add appropriate listeners for resizing content area | ||
ed.onChange.add(resize); | ||
ed.onSetContent.add(resize); | ||
ed.onPaste.add(resize); | ||
ed.onKeyUp.add(resize); | ||
ed.onPostRender.add(resize); | ||
|
||
if (ed.getParam('autoresize_on_init', true)) { | ||
// Things to do when the editor is ready | ||
ed.onInit.add(function(ed, l) { | ||
// Show throbber until content area is resized properly | ||
ed.setProgressState(true); | ||
t.throbbing = true; | ||
|
||
// Hide scrollbars | ||
ed.getBody().style.overflowY = "hidden"; | ||
}); | ||
|
||
ed.onLoadContent.add(function(ed, l) { | ||
resize(); | ||
|
||
// Because the content area resizes when its content CSS loads, | ||
// and we can't easily add a listener to its onload event, | ||
// we'll just trigger a resize after a short loading period | ||
setTimeout(function() { | ||
resize(); | ||
|
||
// Disable throbber | ||
ed.setProgressState(false); | ||
t.throbbing = false; | ||
}, 1250); | ||
}); | ||
} | ||
|
||
// Register the command so that it can be invoked by using tinyMCE.activeEditor.execCommand('mceExample'); | ||
ed.addCommand('mceAutoResize', resize); | ||
}, | ||
|
||
/** | ||
* Returns information about the plugin as a name/value array. | ||
* The current keys are longname, author, authorurl, infourl and version. | ||
* | ||
* @return {Object} Name/value array containing information about the plugin. | ||
*/ | ||
getInfo : function() { | ||
return { | ||
longname : 'Auto Resize', | ||
author : 'Moxiecode Systems AB', | ||
authorurl : 'http://tinymce.moxiecode.com', | ||
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autoresize', | ||
version : tinymce.majorVersion + "." + tinymce.minorVersion | ||
}; | ||
} | ||
}); | ||
|
||
/** | ||
* Auto Resize | ||
* | ||
* This plugin automatically resizes the content area to fit its content height. | ||
* It will retain a minimum height, which is the height of the content area when | ||
* it's initialized. | ||
* | ||
* Tested in: IE6, IE7, IE8 as IE7, IE8 as IE8, Safari 3, Firefox 3, Opera 9, Chrome 1 | ||
* | ||
* Known issues: None | ||
* | ||
* Change log: | ||
* - 1.2: Changed hiding all scrollbars to just hiding the vertical one, so you can still | ||
* have a horizontal scrollbar for wide content. Also added an onload handler to the | ||
* iframe, so that the area resizes after all of the iframe's content has loaded. | ||
* - 1.1: Added throbber and disabled editor until we're pretty sure that all CSS has loaded. | ||
* This should fix an issue where the content area would not resize properly on load | ||
* for people on slower connections. | ||
* - 1.0: Initial release | ||
* | ||
* Not tested with Advanced Theme "theme_advanced_resizing_min_height" and | ||
* "theme_advanced_resizing_max_height" options. | ||
* | ||
* @author Springload | ||
* @version 1.1 | ||
* @requires TinyMCE 3+ | ||
*/ | ||
tinymce.create('tinymce.plugins.AutoResizePlugin', { | ||
/** | ||
* Initializes the plugin, this will be executed after the plugin has been created. | ||
* This call is done before the editor instance has finished it's initialization so use the onInit event | ||
* of the editor instance to intercept that event. | ||
* | ||
* @param {tinymce.Editor} ed Editor instance that the plugin is initialized in. | ||
* @param {string} url Absolute URL to where the plugin is located. | ||
*/ | ||
init : function(ed, url) { | ||
|
||
// Create namespace for variables on the editor instance | ||
tinymce.createNS('springload',ed); | ||
|
||
// Backup TinyMCE default focus function, to prevent jumping in IE | ||
ed.springload.defaultFocus = ed.focus; | ||
ed.focus = function(){} | ||
|
||
// Define minimum height in the namespace | ||
ed.springload.autoresize_min_height = ed.getElement().offsetHeight; | ||
|
||
// Things to do before the editor is ready | ||
ed.onPreInit.add(function(ed) { | ||
|
||
// Get content element, store it in the namespace | ||
ed.springload.content_container = ed.getContentAreaContainer().firstChild; | ||
|
||
// Add onload listener to IFRAME | ||
if(ed.springload.content_container.tagName == 'IFRAME'){ | ||
|
||
tinymce.dom.Event.add(ed.springload.content_container, 'load', function(e) { | ||
tinymce.EditorManager.get(ed.id).execCommand('mceAutoResize'); | ||
}); | ||
|
||
} | ||
|
||
}); | ||
|
||
// Things to do when the editor is ready | ||
ed.onInit.add(function(ed, l) { | ||
|
||
// Show throbber until content area is resized properly | ||
ed.setProgressState(true); | ||
ed.springload.throbbing = true; | ||
|
||
// Hide scrollbars | ||
ed.getBody().style.overflowY = "hidden"; | ||
|
||
}); | ||
|
||
// Add appropriate listeners for resizing content area | ||
ed.onChange.add(function(ed, l) { | ||
ed.execCommand('mceAutoResize'); | ||
}); | ||
ed.onSetContent.add(function(ed, l) { | ||
ed.execCommand('mceAutoResize'); | ||
}); | ||
ed.onPaste.add(function(ed, l) { | ||
ed.execCommand('mceAutoResize'); | ||
}); | ||
ed.onKeyUp.add(function(ed, l) { | ||
ed.execCommand('mceAutoResize'); | ||
}); | ||
ed.onPostRender.add(function(ed, l) { | ||
ed.execCommand('mceAutoResize'); | ||
}); | ||
ed.onLoadContent.add(function(ed, l) { | ||
ed.execCommand('mceAutoResize'); | ||
// Because the content area resizes when its content CSS loads, | ||
// and we can't easily add a listener to its onload event, | ||
// we'll just trigger a resize after a short loading period | ||
setTimeout("tinymce.EditorManager.get('" + ed.id + "').execCommand('mceAutoResizeTimeout');",1250); | ||
}); | ||
|
||
// Interval resize trigger function | ||
ed.addCommand('mceAutoResizeTimeout', function() { | ||
// Resize | ||
this.execCommand('mceAutoResize'); | ||
// Disable throbber | ||
this.setProgressState(false); | ||
this.springload.throbbing = false; | ||
// Restore TinyMCE default focus function | ||
if(typeof(this.springload.defaultFocus) == "function"){ | ||
this.focus = this.springload.defaultFocus; | ||
this.springload.defaultFocus = false; | ||
} | ||
}); | ||
|
||
// Register the command so that it can be invoked by using tinyMCE.activeEditor.execCommand('mceExample'); | ||
ed.addCommand('mceAutoResize', function() { | ||
// Variables | ||
var d = this.getDoc(), b = d.body, de = d.documentElement, DOM=tinymce.DOM, resizeHeight=this.springload.autoresize_min_height; | ||
|
||
// Get height differently depending on the browser used | ||
(tinymce.isIE) ? myHeight = b.scrollHeight : myHeight = de.offsetHeight; | ||
|
||
// Don't make it smaller than the minimum height | ||
if(myHeight > this.springload.autoresize_min_height){ | ||
resizeHeight = myHeight; | ||
} | ||
|
||
// Resize content element | ||
DOM.setStyle(this.springload.content_container, 'height', resizeHeight + 'px'); | ||
|
||
// if we're throbbing, we'll re-throb to match the new size | ||
if(this.springload.throbbing){ | ||
this.setProgressState(false); | ||
this.setProgressState(true); | ||
} | ||
|
||
}); | ||
|
||
|
||
}, | ||
|
||
/** | ||
* Returns information about the plugin as a name/value array. | ||
* The current keys are longname, author, authorurl, infourl and version. | ||
* | ||
* @return {Object} Name/value array containing information about the plugin. | ||
*/ | ||
getInfo : function() { | ||
return { | ||
longname : 'Auto Resize', | ||
author : 'Springload', | ||
authorurl : 'http://www.springload.co.nz', | ||
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins', | ||
version : "1.2" | ||
}; | ||
} | ||
|
||
}); | ||
|
||
// Register plugin | ||
tinymce.PluginManager.add('autoresize', tinymce.plugins.AutoResizePlugin); | ||
// Register plugin | ||
tinymce.PluginManager.add('autoresize', tinymce.plugins.AutoResizePlugin); | ||
})(); |