|
@@ -271,3 +271,100 @@ Index: sites/all/modules/img_assist/img_assist.module
|
|
|
// Never delete original image.
|
|
// Never delete original image.
|
|
|
if ($file->filepath != $node->images[IMAGE_ORIGINAL]) {
|
|
if ($file->filepath != $node->images[IMAGE_ORIGINAL]) {
|
|
|
|
|
|
|
|
|
|
+-----------------------------------------------------------------------------
|
|
|
|
|
+
|
|
|
|
|
+Optimize "img_assist" module by loading only when necessary.
|
|
|
|
|
+http://drupal.org/node/55101
|
|
|
|
|
+
|
|
|
|
|
+Index: sites/all/modules/img_assist/img_assist.js
|
|
|
|
|
+--- sites/all/modules/img_assist/img_assist.js.orig 2008-04-06 18:43:18 +0200
|
|
|
|
|
++++ sites/all/modules/img_assist/img_assist.js 2008-05-02 21:05:56 +0200
|
|
|
|
|
+@@ -130,6 +130,24 @@
|
|
|
|
|
+ var win = window.open(BASE_URL + 'index.php?q=img_assist/popup/' + nid, 'imagev', 'height='+oy+'-10,width='+ox+',top='+winy+',left='+winx+',scrollbars='+use_scrollbars+',resizable');
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
++function launch_popup(nid, mw, mh) {
|
|
|
|
|
++ var ox = mw;
|
|
|
|
|
++ var oy = mh;
|
|
|
|
|
++ if((ox>=screen.width) || (oy>=screen.height)){
|
|
|
|
|
++ var ox = screen.width-150;
|
|
|
|
|
++ var oy = screen.height-150;
|
|
|
|
|
++ var winx = (screen.width / 2)-(ox / 2);
|
|
|
|
|
++ var winy = (screen.height / 2)-(oy / 2);
|
|
|
|
|
++ var use_scrollbars = 1;
|
|
|
|
|
++ }
|
|
|
|
|
++ else{
|
|
|
|
|
++ var winx = (screen.width / 2)-(ox / 2);
|
|
|
|
|
++ var winy = (screen.height / 2)-(oy / 2);
|
|
|
|
|
++ var use_scrollbars = 0;
|
|
|
|
|
++ }
|
|
|
|
|
++ var win = window.open(BASE_URL + 'index.php?q=img_assist/popup/' + nid, 'imagev', 'height='+oy+'-10,width='+ox+',top='+winy+',left='+winx+',scrollbars='+use_scrollbars+',resizable');
|
|
|
|
|
++}
|
|
|
|
|
++
|
|
|
|
|
+ function insertImage() {
|
|
|
|
|
+ if (window.opener) {
|
|
|
|
|
+ // Get variables from the fields on the properties frame
|
|
|
|
|
+Index: sites/all/modules/img_assist/img_assist.module
|
|
|
|
|
+--- sites/all/modules/img_assist/img_assist.module.orig 2008-05-02 21:04:49 +0200
|
|
|
|
|
++++ sites/all/modules/img_assist/img_assist.module 2008-05-02 21:07:24 +0200
|
|
|
|
|
+@@ -126,7 +126,7 @@
|
|
|
|
|
+ }
|
|
|
|
|
+ // Assign base_path to insert in image source by javascript.
|
|
|
|
|
+ drupal_add_js('var BASE_URL = "'. base_path() .'";', 'inline');
|
|
|
|
|
+- drupal_add_js($path .'/img_assist.js');
|
|
|
|
|
++ drupal_add_js($path .'/img_assist_popup.js');
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+@@ -150,6 +150,9 @@
|
|
|
|
|
+ * Add image link underneath textareas.
|
|
|
|
|
+ */
|
|
|
|
|
+ function img_assist_textarea($element) {
|
|
|
|
|
++ $path = drupal_get_path('module', 'img_assist');
|
|
|
|
|
++ drupal_add_js($path .'/img_assist.js');
|
|
|
|
|
++
|
|
|
|
|
+ $link = variable_get('img_assist_link', 'icon');
|
|
|
|
|
+ if (($link == 'icon') || ($link == 'text')) {
|
|
|
|
|
+ if (_img_assist_textarea_match($element['#id']) && _img_assist_page_match() && !strstr($_GET['q'], 'img_assist')) {
|
|
|
|
|
+Index: sites/all/modules/img_assist/img_assist_popup.js
|
|
|
|
|
+--- /dev/null 2008-05-02 21:08:21 +0200
|
|
|
|
|
++++ sites/all/modules/img_assist/img_assist_popup.js 2008-05-02 21:05:56 +0200
|
|
|
|
|
+@@ -0,0 +1,20 @@
|
|
|
|
|
++/* $Id: drupal.patch,v 1.5 2008/05/02 19:17:58 rse Exp $ */
|
|
|
|
|
++
|
|
|
|
|
++function launch_popup(nid, mw, mh) {
|
|
|
|
|
++ var ox = mw;
|
|
|
|
|
++ var oy = mh;
|
|
|
|
|
++ if((ox>=screen.width) || (oy>=screen.height)){
|
|
|
|
|
++ var ox = screen.width-150;
|
|
|
|
|
++ var oy = screen.height-150;
|
|
|
|
|
++ var winx = (screen.width / 2)-(ox / 2);
|
|
|
|
|
++ var winy = (screen.height / 2)-(oy / 2);
|
|
|
|
|
++ var use_scrollbars = 1;
|
|
|
|
|
++ }
|
|
|
|
|
++ else{
|
|
|
|
|
++ var winx = (screen.width / 2)-(ox / 2);
|
|
|
|
|
++ var winy = (screen.height / 2)-(oy / 2);
|
|
|
|
|
++ var use_scrollbars = 0;
|
|
|
|
|
++ }
|
|
|
|
|
++ var win = window.open(BASE_URL + 'index.php?q=img_assist/popup/' + nid, 'imagev', 'height='+oy+'-10,width='+ox+',top='+winy+',left='+winx+',scrollbars='+use_scrollbars+',resizable');
|
|
|
|
|
++}
|
|
|
|
|
++
|
|
|
|
|
+
|
|
|
|
|
+-----------------------------------------------------------------------------
|
|
|
|
|
+
|
|
|
|
|
+Fix file permissions.
|
|
|
|
|
+http://drupal.org/node/247992
|
|
|
|
|
+
|
|
|
|
|
+Index: sites/all/modules/img_assist/img_assist.module
|
|
|
|
|
+--- sites/all/modules/img_assist/img_assist.module.orig 2008-05-02 21:11:15 +0200
|
|
|
|
|
++++ sites/all/modules/img_assist/img_assist.module 2008-05-02 21:11:48 +0200
|
|
|
|
|
+@@ -1230,6 +1230,8 @@
|
|
|
|
|
+ drupal_set_message(t('Unable to create %label image', array('%label' => $size['label'])), 'error');
|
|
|
|
|
+ }
|
|
|
|
|
+ else {
|
|
|
|
|
++ // Set standard file permissions for webserver-generated files
|
|
|
|
|
++ @chmod(file_create_path($destination), 0664);
|
|
|
|
|
+ $node->images[$key] = $destination;
|
|
|
|
|
+ _image_insert($node, $key, file_create_path($destination));
|
|
|
|
|
+ }
|